:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --line: #d3dde6;
  --text: #17212b;
  --muted: #647484;
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(24, 38, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body [hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

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

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #a7b7c7;
  border-radius: 8px;
  background: #182634;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  background: var(--panel-soft);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  color: #123b66;
  background: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

.app {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 300px;
  gap: 12px;
  padding: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.side,
.inspector {
  overflow: auto;
}

.control-block {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.control-block:last-child {
  border-bottom: 0;
}

.control-block h2 {
  font-size: 13px;
  margin-bottom: 10px;
}

.upload-box {
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed #8ca0b2;
  border-radius: 8px;
  background: var(--panel-soft);
  color: #324252;
  cursor: pointer;
  text-align: center;
}

.upload-box input {
  display: none;
}

.upload-progress {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.upload-progress-head,
.upload-progress-detail {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #405469;
}

.upload-progress-track {
  height: 8px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf5;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.18s ease;
}

.upload-progress-detail {
  min-height: 16px;
  color: #64748b;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  display: none;
}

.segmented span {
  display: block;
  padding: 7px 8px;
  border-radius: 6px;
  text-align: center;
  color: var(--muted);
}

.segmented input:checked + span {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(24, 38, 52, 0.12);
}

.manual-roi-panel {
  margin-top: 10px;
  display: grid;
  gap: 9px;
}

.roi-preview-stage {
  position: relative;
  min-height: 120px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8eef4;
  cursor: crosshair;
}

.roi-preview-stage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  background: #ffffff;
  user-select: none;
  pointer-events: none;
}

.roi-selection {
  position: absolute;
  border: 2px solid #0b73d9;
  background: rgba(11, 115, 217, 0.12);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

.roi-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.roi-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.roi-fields input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #ffffff;
  color: var(--text);
}

.roi-meta {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.task-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.task-head input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.model-status {
  color: var(--muted);
  font-size: 11px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px;
}

.primary {
  width: calc(100% - 28px);
  margin: 14px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.primary:disabled {
  cursor: progress;
  opacity: 0.65;
}

.secondary {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #243445;
  cursor: pointer;
}

.meta-text {
  min-height: 40px;
  color: var(--muted);
  line-height: 1.5;
}

.downloads {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.downloads a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #123b66;
  background: #f8fafc;
  text-decoration: none;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.tabs,
.zoom-tools {
  display: flex;
  gap: 6px;
}

.tab,
.zoom-tools button {
  min-width: 40px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #243445;
  cursor: pointer;
}

.tab.active {
  border-color: #7fb4aa;
  background: #e8f4f2;
  color: #0f5f58;
  font-weight: 800;
}

.viewer {
  position: relative;
  overflow: hidden;
  background: #dce5ed;
}

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  cursor: grab;
}

.stage.dragging {
  cursor: grabbing;
}

.stack {
  position: relative;
  width: min(100%, 100vh);
  max-width: 100%;
  max-height: 100%;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 38, 52, 0.18);
}

.stack img {
  user-select: none;
  -webkit-user-drag: none;
}

.base-image,
.layer-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.base-image {
  z-index: 1;
}

#layerHost {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.layer-image {
  pointer-events: none;
}

.legend-app {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 320px minmax(620px, 1fr);
  gap: 12px;
  padding: 12px;
}

.legend-workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.legend-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

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

.legend-result-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 45%) minmax(420px, 55%);
  overflow: hidden;
}

.legend-preview,
.legend-table-wrap {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.legend-preview {
  border-right: 1px solid var(--line);
}

.legend-preview h2,
.legend-table-wrap h2 {
  font-size: 13px;
  margin: 0 0 10px;
}

.legend-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.legend-preview figure,
.sheet-list figure {
  margin: 0;
}

.legend-preview figcaption,
.sheet-list figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.legend-image-scroll,
.legend-sheet-scroll {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  overflow: auto;
}

.legend-image-scroll {
  height: 260px;
}

.legend-image-scroll img {
  max-width: none;
  width: 560px;
  height: auto;
  display: block;
}

.manual-region-tools {
  display: none;
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.manual-region-tools.active {
  display: grid;
}

.manual-region-tools .meta-text {
  min-height: 0;
  font-size: 12px;
}

.legend-selection-stage {
  position: relative;
  display: inline-block;
  min-width: 1px;
  min-height: 1px;
}

.legend-selection-stage.manual-enabled {
  cursor: crosshair;
}

.legend-selection-stage img {
  user-select: none;
  -webkit-user-drag: none;
}

.legend-selection-rect {
  position: absolute;
  display: none;
  border: 2px solid #ef4444;
  background: rgba(239, 68, 68, 0.13);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.sheet-list {
  display: grid;
  gap: 12px;
}

.legend-sheet-scroll {
  max-height: 540px;
}

.legend-sheet-scroll img {
  width: 100%;
  height: auto;
  display: block;
}

.legend-item-cards {
  display: grid;
  gap: 10px;
}

.legend-item-card {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.legend-item-card.invalid {
  border-color: #f1b7bd;
  background: #fff8f8;
}

.legend-item-image {
  height: 130px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  background: #f8fafc;
}

.legend-item-image img {
  height: 100%;
  width: auto;
  min-width: 100%;
  object-fit: contain;
  display: block;
}

.legend-item-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.legend-item-body header span {
  color: var(--muted);
  font-size: 12px;
}

.legend-item-body dl {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
}

.legend-item-body dt {
  color: var(--muted);
}

.legend-item-body dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.layer-controls {
  display: grid;
  gap: 8px;
}

.layer-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel-soft);
}

.layer-control header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.layer-control label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.layer-control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.layer-control input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent-2);
}

.layout-qa-details {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid rgba(18, 58, 55, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.68);
}

.layout-qa-details > strong {
  margin-bottom: 2px;
  color: #294743;
  font-size: 11px;
}

.layout-qa-row {
  display: grid;
  grid-template-columns: 10px 54px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.layout-qa-row i {
  width: 9px;
  height: 9px;
  border: 2px solid var(--layout-color);
  border-radius: 2px;
  background: color-mix(in srgb, var(--layout-color) 12%, transparent);
}

.layout-qa-row span {
  color: #294743;
  font-size: 10px;
  font-weight: 700;
}

.layout-qa-row small {
  overflow: hidden;
  color: #6a7d79;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.qa-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 700;
}

.method-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.35;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 700;
}

.method-linecut {
  border-color: #8aaed8;
  color: #174f87;
  background: #edf5ff;
}

.method-boundary {
  border-color: #7cb89d;
  color: #176344;
  background: #eefaf4;
}

.method-direct {
  border-color: #b7a5d8;
  color: #5b3c8a;
  background: #f4efff;
}

.method-unknown {
  border-color: #c5ccd3;
  color: #5b6570;
  background: #f4f6f8;
}

.method-detail {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.qa-review_pass {
  border-color: #9ac7ad;
  color: #176445;
  background: #edf8f1;
}

.qa-needs_review {
  border-color: #e5b46a;
  color: #8a4f0c;
  background: #fff7e8;
}

.qa-reject {
  border-color: #e59a9a;
  color: #a21d1d;
  background: #fff0f0;
}

.qa-detail {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.summary {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1720;
  color: #d8e4ee;
  font-size: 11px;
  line-height: 1.55;
}

.status-pill.ready {
  border-color: #8ac4a6;
  color: #0d7048;
  background: #e9f7ef;
}

.home-main {
  min-height: calc(100vh - 68px);
  padding: 18px;
}

.home-hero {
  display: flex;
  align-items: center;
  min-height: 116px;
  padding: 22px;
  margin-bottom: 14px;
}

.home-hero h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.home-hero p,
.home-card p {
  color: var(--muted);
  line-height: 1.6;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-card {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
}

.home-card:hover {
  border-color: #9db5c8;
}

.home-card-code {
  width: 46px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #182634;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
}

.home-card strong {
  font-size: 17px;
}

.home-data {
  margin-top: 14px;
  padding: 18px;
}

.home-data-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.home-data-head h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.home-data-head p {
  color: var(--muted);
  line-height: 1.6;
}

.home-data-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.home-data-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.home-data-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  min-width: 0;
}

.home-data-stat span,
.home-data-family-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.home-data-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 22px;
}

.home-data-stat small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.home-data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 14px;
}

.home-data-families {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-data-family,
.home-data-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  min-width: 0;
}

.home-data-family {
  padding: 12px;
}

.home-data-family-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.home-data-family-head h3,
.home-data-block h3 {
  font-size: 16px;
}

.home-data-family-head strong {
  flex: 0 0 auto;
  color: #17202a;
  font-size: 18px;
}

.home-data-family-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.home-data-family-metrics span {
  border: 1px solid #dbe5ee;
  border-radius: 999px;
  padding: 4px 8px;
  color: #435363;
  background: #f8fafc;
  font-size: 12px;
}

.home-data-mini-table,
.home-data-table {
  width: 100%;
  border-collapse: collapse;
}

.home-data-mini-table th,
.home-data-mini-table td,
.home-data-table th,
.home-data-table td {
  border-bottom: 1px solid #e3eaf0;
  padding: 7px 6px;
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

.home-data-mini-table th,
.home-data-table th {
  color: #52616f;
  background: #f4f7fa;
  font-weight: 700;
}

.home-data-mini-table td:first-child {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-data-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.home-data-block {
  overflow: hidden;
}

.home-data-block h3 {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef3f7;
}

.home-table-wrap {
  overflow-x: auto;
}

.home-data-notes {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px 28px;
  color: #435363;
  line-height: 1.55;
  font-size: 13px;
}

.home-data-error {
  border: 1px solid #e6b6b6;
  border-radius: 8px;
  padding: 12px;
  color: #8a2020;
  background: #fff5f5;
}

.superres-app {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.ab-app {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.ab-controls {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ab-block {
  display: grid;
  gap: 10px;
}

.ab-block h2 {
  font-size: 14px;
  margin: 0;
}

.ab-task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ab-task-check {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  color: #435363;
  background: #fbfdff;
  font-size: 13px;
}

.ab-workspace {
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.ab-result {
  height: calc(100vh - 94px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ab-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.ab-result-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.ab-result-head p {
  color: var(--muted);
  line-height: 1.45;
}

#abReviewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.superres-controls {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.superres-dropzone {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 12px;
  border: 1px dashed #8ca0b2;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.superres-dropzone.drag {
  border-color: #0b63ce;
  background: #eef5ff;
}

.superres-dropzone input {
  display: none;
}

.superres-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.superres-field small {
  line-height: 1.45;
}

.superres-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.superres-run {
  width: 100%;
  margin: 0;
}

.superres-workspace {
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.superres-empty,
.superres-busy {
  min-height: calc(100vh - 94px);
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.superres-empty strong,
.superres-busy strong {
  color: var(--text);
  font-size: 16px;
}

.superres-busy {
  grid-template-columns: auto auto;
  align-content: center;
  justify-content: center;
  text-align: left;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #c8d2dc;
  border-top-color: #0b63ce;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.superres-result {
  height: calc(100vh - 94px);
  overflow: auto;
}

.superres-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.superres-result-head h2 {
  font-size: 16px;
}

.superres-result-head p {
  color: var(--muted);
  margin-top: 4px;
}

.superres-compare {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.superres-compare-stage {
  position: relative;
  width: 100%;
  height: 620px;
  overflow: hidden;
  background: #e9edf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.superres-compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.superres-after-wrap {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
}

.superres-after-wrap img {
  width: 100%;
  max-width: none;
}

.superres-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

#superresCompareSlider {
  width: 100%;
  margin: 12px 0 4px;
  accent-color: var(--accent);
}

.superres-compare-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.superres-zoom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.superres-zoom-panel {
  min-width: 0;
  background: #ffffff;
}

.superres-panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.superres-panel-head h3 {
  font-size: 15px;
  white-space: nowrap;
}

.superresZoomRange {
  width: min(280px, 52%);
  accent-color: var(--accent-2);
}

.superres-zoom-stage {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: #e9edf2;
  cursor: grab;
}

.superres-zoom-stage:active {
  cursor: grabbing;
}

.superres-zoom-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .app {
    height: auto;
    min-height: calc(100vh - 68px);
    grid-template-columns: 1fr;
  }

  .home-grid,
  .home-data-layout,
  .home-data-families,
  .ab-app,
  .superres-app,
  .superres-zoom-grid {
    grid-template-columns: 1fr;
  }

  .home-data-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-data-head {
    display: grid;
  }

  .workspace {
    min-height: 68vh;
  }

  .superres-result,
  .ab-result,
  .superres-empty,
  .superres-busy {
    min-height: 68vh;
    height: auto;
  }

  #abReviewFrame {
    height: 78vh;
  }
}

@media (max-width: 640px) {
  .home-main {
    padding: 10px;
  }

  .home-data {
    padding: 12px;
  }

  .home-data-stats {
    grid-template-columns: 1fr;
  }
}

.delivery-main {
  min-height: calc(100vh - 68px);
  padding: 18px;
}

.delivery-hero,
.delivery-blockers {
  max-width: 1180px;
  margin: 0 auto 14px;
  padding: 16px;
}

.delivery-hero h2,
.delivery-blockers h2,
.delivery-card h2 {
  margin: 0 0 8px;
}

.delivery-grid {
  max-width: 1180px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.delivery-card {
  padding: 16px;
}

.delivery-card p {
  min-height: 58px;
  color: var(--muted);
  line-height: 1.55;
}

.delivery-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.delivery-status code {
  color: #8a3b08;
  white-space: normal;
  text-align: right;
}

.delivery-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.delivery-blockers table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.delivery-blockers th,
.delivery-blockers td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

@media (max-width: 1100px) {
  .delivery-grid {
    grid-template-columns: 1fr;
  }
}

/* Client-facing home */
.home-page {
  --home-ink: #163c3a;
  --home-ink-deep: #092c2c;
  --home-paper: #f4f0e7;
  --home-paper-light: #fbfaf6;
  --home-clay: #cf5942;
  --home-gold: #c99345;
  --home-mint: #8fb9a8;
  background:
    radial-gradient(circle at 12% 4%, rgba(207, 89, 66, 0.08), transparent 26rem),
    linear-gradient(180deg, #f7f4ed 0, #efede5 100%);
  color: #17302f;
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

.home-page h1,
.home-page h2,
.home-page h3,
.home-page strong {
  letter-spacing: -0.02em;
}

.home-topbar {
  position: relative;
  z-index: 20;
  height: 82px;
  padding: 0 clamp(22px, 5vw, 76px);
  border-bottom-color: rgba(22, 60, 58, 0.13);
  background: rgba(247, 244, 237, 0.88);
  backdrop-filter: blur(18px);
}

.home-brand {
  color: inherit;
  text-decoration: none;
}

.home-brand .mark {
  width: 45px;
  height: 45px;
  border: 0;
  border-radius: 50% 50% 48% 52% / 48% 46% 54% 52%;
  background: var(--home-ink);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 8px 20px rgba(9,44,44,.16);
}

.home-brand h1 {
  font-size: 19px;
  font-weight: 900;
  color: var(--home-ink-deep);
}

.home-brand p {
  color: #657674;
  letter-spacing: .08em;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.home-nav a {
  color: #4d6562;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.home-nav a:hover {
  color: var(--home-ink);
}

.home-nav .home-nav-primary {
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--home-ink);
  color: #fffdf6;
  box-shadow: 0 8px 18px rgba(9,44,44,.16);
}

.home-main {
  width: min(1440px, 100%);
  min-height: auto;
  margin: 0 auto;
  padding: 28px clamp(18px, 5vw, 76px) 82px;
}

.home-hero {
  position: relative;
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, .94fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  overflow: hidden;
  margin: 0 0 92px;
  padding: clamp(48px, 7vw, 92px);
  border: 0;
  border-radius: 28px 28px 110px 28px;
  color: #f9f5ea;
  background:
    linear-gradient(125deg, rgba(255,255,255,.035) 0 1px, transparent 1px 78px),
    linear-gradient(155deg, #0c3937 0%, #123f3c 48%, #092b2d 100%);
  box-shadow: 0 34px 80px rgba(9,44,44,.22);
  animation: home-rise .65s cubic-bezier(.2,.8,.2,1) both;
}

.home-hero::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -150px;
  bottom: -260px;
  border: 1px solid rgba(246,236,211,.16);
  border-radius: 42% 58% 47% 53%;
  box-shadow: 0 0 0 34px rgba(246,236,211,.025), 0 0 0 80px rgba(246,236,211,.018);
  transform: rotate(-18deg);
}

.home-hero-copy {
  position: relative;
  z-index: 2;
}

.home-eyebrow,
.home-section-index {
  display: block;
  margin-bottom: 20px;
  color: #cf9c55;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .19em;
}

.home-hero h2 {
  max-width: 720px;
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: clamp(40px, 5vw, 70px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.055em;
}

.home-hero h2 em {
  color: #e3b06a;
  font-style: normal;
}

.home-hero-copy > p {
  max-width: 630px;
  margin-top: 26px;
  color: rgba(249,245,234,.72);
  font-size: 16px;
  line-height: 1.9;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.home-cta {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0 22px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}

.home-cta:hover {
  transform: translateY(-2px);
}

.home-cta-primary {
  border-color: #d25e48;
  background: var(--home-clay);
}

.home-cta-primary b {
  font-size: 18px;
}

.home-cta-secondary {
  background: rgba(255,255,255,.05);
}

.home-hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 36px;
  color: rgba(249,245,234,.62);
  font-size: 12px;
}

.home-hero-proof span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.home-hero-proof i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e0a95e;
  box-shadow: 0 0 0 4px rgba(224,169,94,.1);
}

.home-hero-visual {
  position: relative;
  z-index: 2;
  min-height: 420px;
}

.home-map-sheet {
  position: absolute;
  inset: 5px 20px 58px 35px;
  overflow: hidden;
  border: 8px solid rgba(246,239,222,.88);
  border-radius: 3px;
  background: #e9dfc7;
  box-shadow: -24px 32px 50px rgba(0,0,0,.28), 24px -18px 0 rgba(255,255,255,.06);
  transform: rotate(3.2deg);
}

.home-map-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .4;
  background: repeating-linear-gradient(0deg, transparent 0 12px, rgba(58,73,58,.035) 13px);
  mix-blend-mode: multiply;
}

.home-map-label {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 20px;
  color: #31554f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
}

.home-contour {
  position: absolute;
  border: 3px solid #385f59;
  border-radius: 47% 53% 61% 39% / 45% 38% 62% 55%;
}

.contour-a {
  width: 70%;
  height: 54%;
  left: -12%;
  top: 15%;
  background: #d9b48b;
  box-shadow: inset 0 0 0 15px #d9b48b, inset 0 0 0 18px #385f59, inset 0 0 0 36px #b7d1bd;
  transform: rotate(17deg);
}

.contour-b {
  width: 64%;
  height: 50%;
  right: -15%;
  top: -2%;
  background: #d7c766;
  box-shadow: inset 0 0 0 22px #d7c766, inset 0 0 0 25px #385f59, inset 0 0 0 50px #cf8e7b;
  transform: rotate(-24deg);
}

.contour-c {
  width: 78%;
  height: 53%;
  right: -18%;
  bottom: -18%;
  background: #8ab8b1;
  box-shadow: inset 0 0 0 20px #8ab8b1, inset 0 0 0 23px #385f59, inset 0 0 0 44px #e0c89d;
  transform: rotate(9deg);
}

.home-map-fault {
  position: absolute;
  z-index: 3;
  width: 120%;
  height: 3px;
  left: -10%;
  top: 54%;
  background: #a33f36;
  box-shadow: 55px 15px 0 #a33f36, 130px -13px 0 #a33f36;
  transform: rotate(-25deg);
}

.home-map-point {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  border: 3px solid #a33f36;
  border-radius: 50%;
  background: #e9dfc7;
}

.point-a { left: 29%; top: 65%; }
.point-b { right: 20%; top: 29%; }

.home-map-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .12;
  background-image: linear-gradient(#173f3a 1px, transparent 1px), linear-gradient(90deg, #173f3a 1px, transparent 1px);
  background-size: 52px 52px;
}

.home-visual-note {
  position: absolute;
  z-index: 5;
  right: -8px;
  bottom: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  min-width: 220px;
  padding: 14px 17px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(7,35,35,.83);
  box-shadow: 0 16px 34px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
}

.home-visual-note span {
  color: #dfa75d;
  font-family: Georgia, serif;
  font-size: 27px;
}

.home-visual-note p {
  color: rgba(255,255,255,.72);
  font-size: 11px;
  line-height: 1.55;
}

.home-capabilities {
  margin-bottom: 92px;
}

.home-section-heading {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 30px;
}

.home-section-heading h2 {
  color: var(--home-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: clamp(31px, 4vw, 48px);
}

.home-section-heading p {
  max-width: 680px;
  color: #647472;
  font-size: 14px;
  line-height: 1.8;
}

.home-section-index {
  margin-bottom: 11px;
  color: var(--home-clay);
}

.home-grid {
  grid-template-columns: 1.18fr .91fr .91fr;
  gap: 18px;
}

.home-card {
  position: relative;
  min-height: 360px;
  gap: 17px;
  padding: 26px;
  border: 1px solid rgba(22,60,58,.13);
  border-radius: 18px;
  background: rgba(251,250,246,.86);
  box-shadow: 0 18px 45px rgba(30,54,51,.07);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  animation: home-rise .55s calc(90ms + var(--card-index, 0) * 70ms) both;
}

.home-card:nth-child(2) { --card-index: 1; }
.home-card:nth-child(3) { --card-index: 2; }

.home-card:hover {
  border-color: rgba(22,60,58,.34);
  box-shadow: 0 24px 55px rgba(30,54,51,.12);
  transform: translateY(-5px);
}

.home-card-featured {
  background: linear-gradient(145deg, #fffdf7, #e7eee9);
}

.home-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #879693;
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: .1em;
}

.home-card-top b {
  padding: 5px 8px;
  border: 1px solid rgba(22,60,58,.13);
  border-radius: 999px;
  color: #607471;
  font-family: inherit;
  font-size: 9px;
}

.home-card-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-top: 10px;
  border-radius: 21px 13px 21px 13px;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 26px;
  box-shadow: 0 12px 22px rgba(17,59,56,.14);
}

.home-card-icon-vector { background: var(--home-ink); }
.home-card-icon-legend { background: var(--home-clay); }
.home-card-icon-superres { background: var(--home-gold); }

.home-card strong {
  color: var(--home-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 24px;
}

.home-card p {
  color: #60706e;
  font-size: 14px;
  line-height: 1.8;
}

.home-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: auto;
}

.home-card-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #49635f;
  background: rgba(22,60,58,.07);
  font-size: 10px;
}

.home-card-meta i {
  margin-left: auto;
  color: var(--home-clay);
  font-style: normal;
  font-weight: 900;
}

.home-data {
  position: relative;
  margin: 0;
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid rgba(22,60,58,.13);
  border-radius: 28px;
  background: rgba(251,250,246,.84);
  box-shadow: 0 28px 70px rgba(30,54,51,.09);
}

.home-data-heading {
  grid-template-columns: .8fr 1.2fr;
  align-items: start;
}

.home-data-heading-side {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.home-data-badge {
  border-color: rgba(22,60,58,.16);
  color: #566c69;
  background: #f1f4ee;
}

.home-data-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 36px 0 28px;
  border: 1px solid rgba(22,60,58,.13);
  border-radius: 16px;
  background: rgba(22,60,58,.13);
}

.home-data-stat {
  min-height: 138px;
  padding: 19px;
  border: 0;
  border-radius: 0;
  background: #f9f8f3;
  animation: home-rise .45s var(--delay) both;
}

.home-data-stat span {
  color: #70817e;
  font-size: 11px;
  font-weight: 800;
}

.home-data-stat > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 12px 0 9px;
}

.home-data-stat strong {
  margin: 0;
  color: var(--home-ink-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 2.4vw, 38px);
  letter-spacing: -.04em;
}

.home-data-stat b {
  color: var(--home-clay);
  font-size: 11px;
}

.home-data-stat small {
  color: #87938f;
  font-size: 10px;
}

.home-data-overview {
  display: grid;
  grid-template-columns: minmax(320px, .76fr) minmax(600px, 1.24fr);
  gap: 18px;
  margin-bottom: 35px;
}

.home-data-block {
  overflow: hidden;
  border-color: rgba(22,60,58,.13);
  border-radius: 16px;
  background: #fffdf8;
}

.home-data-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(22,60,58,.1);
  background: #f3f2ec;
}

.home-data-block-head span,
.home-family-heading span {
  color: var(--home-clay);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .17em;
}

.home-data-block-head h3,
.home-family-heading h3 {
  margin-top: 5px;
  color: var(--home-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 19px;
}

.home-data-block-head b {
  padding: 5px 8px;
  border-radius: 999px;
  color: #647773;
  background: rgba(22,60,58,.07);
  font-size: 9px;
}

#clientDataSplit {
  padding: 20px;
}

.home-split-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.home-split-total strong {
  color: var(--home-ink-deep);
  font-family: Georgia, serif;
  font-size: 38px;
}

.home-split-total span {
  color: #71817e;
  font-size: 11px;
}

.home-split-bar {
  height: 9px;
  display: flex;
  gap: 2px;
  overflow: hidden;
  margin: 13px 0 19px;
  border-radius: 999px;
  background: #e4e7e0;
}

.home-split-bar span {
  min-width: 3px;
}

.home-split-rows {
  display: grid;
  gap: 10px;
}

.home-split-row {
  display: grid;
  grid-template-columns: 7px 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.home-split-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.home-split-row span {
  color: #60716e;
  font-size: 11px;
}

.home-split-row strong {
  color: var(--home-ink-deep);
  font-family: Georgia, serif;
}

.home-split-row small {
  width: 50px;
  color: #92a09d;
  font-size: 9px;
  text-align: right;
}

.home-holdout {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 9px;
  margin-top: 18px;
  padding: 12px;
  border: 1px dashed rgba(22,60,58,.22);
  border-radius: 10px;
  background: #f5f5ef;
}

.home-holdout span,
.home-holdout small {
  color: #7b8986;
  font-size: 9px;
}

.home-holdout strong {
  justify-self: end;
  color: var(--home-ink);
}

.home-holdout small {
  grid-column: 1 / -1;
}

.home-source-card .home-table-wrap {
  max-height: 310px;
}

.home-data-table th,
.home-data-table td {
  padding: 11px 12px;
  border-bottom-color: rgba(22,60,58,.08);
  font-size: 11px;
  white-space: nowrap;
}

.home-data-table th {
  color: #71807d;
  background: #faf9f4;
}

.home-data-table td {
  color: #586a67;
}

.home-data-table td strong {
  color: var(--home-ink-deep);
}

.home-split-tag {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  color: #49635e;
  background: #e9f0ea;
  font-size: 9px;
}

.home-split-tag[data-split="val"] { color: #8b5d21; background: #f6eddc; }
.home-split-tag[data-split="test"] { color: #9e4536; background: #f8e7e3; }
.home-split-tag[data-split="holdout"] { color: #58636c; background: #e9ecee; }

.home-family-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin: 0 0 17px;
}

.home-family-heading p {
  max-width: 560px;
  color: #74827f;
  font-size: 11px;
  line-height: 1.6;
}

.home-data-families {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-data-family {
  padding: 19px;
  border-color: rgba(22,60,58,.13);
  border-radius: 15px;
  background: #fffdf8;
  animation: home-rise .5s var(--delay) both;
}

.home-data-family[data-family="area"] { --family: #1a766e; }
.home-data-family[data-family="line"] { --family: #cf5942; }
.home-data-family[data-family="point"] { --family: #bf883d; }
.home-data-family[data-family="annotation"] { --family: #57746d; }

.home-data-family-head {
  margin-bottom: 17px;
}

.home-data-family-head span {
  color: var(--family);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

.home-data-family-head h3 {
  margin-top: 5px;
  color: var(--home-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 18px;
}

.home-data-family-head > strong {
  color: var(--family);
  font-family: Georgia, serif;
  font-size: 27px;
}

.home-data-family-head > strong small {
  font-family: inherit;
  font-size: 10px;
}

.home-family-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.home-family-numbers div {
  padding: 10px;
  border-radius: 9px;
  background: #f3f3ed;
}

.home-family-numbers span {
  display: block;
  margin-bottom: 4px;
  color: #84918e;
  font-size: 9px;
}

.home-family-numbers strong {
  color: #294541;
  font-family: Georgia, serif;
  font-size: 17px;
}

.home-family-share {
  height: 4px;
  overflow: hidden;
  margin: 13px 0 8px;
  border-radius: 99px;
  background: #e5e7e0;
}

.home-family-share span {
  display: block;
  height: 100%;
  background: var(--family);
}

.home-family-splits {
  color: #899692;
  font-size: 9px;
}

.home-category-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(22,60,58,.09);
  list-style: none;
}

.home-category-list li {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.home-category-rank {
  color: #a0aaa7;
  font-family: Georgia, serif;
  font-size: 9px;
}

.home-category-list div {
  min-width: 0;
}

.home-category-list strong {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  color: #596b68;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-category-list i {
  height: 2px;
  display: block;
  overflow: hidden;
  background: #e4e6df;
}

.home-category-list i b {
  height: 100%;
  display: block;
  background: var(--family);
}

.home-category-list em {
  color: #75837f;
  font-family: Georgia, serif;
  font-size: 10px;
  font-style: normal;
}

.home-data-notice {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: var(--home-ink-deep);
}

.home-data-notice > div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f5f0e4;
}

.home-data-notice > div span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #dfa75d;
  font-family: Georgia, serif;
}

.home-data-notes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 26px;
  margin: 0;
  padding: 0 0 0 18px;
  color: rgba(255,255,255,.63);
  font-size: 10px;
}

.home-footer {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px clamp(22px, 5vw, 76px);
  color: rgba(255,255,255,.5);
  background: var(--home-ink-deep);
}

.home-footer div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.home-footer strong {
  color: #f7f1e4;
  font-size: 18px;
}

.home-footer span,
.home-footer p {
  font-size: 11px;
}

@keyframes home-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .home-hero {
    min-height: 540px;
    grid-template-columns: 1fr .8fr;
    padding: 54px;
  }

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

  .home-data-overview {
    grid-template-columns: 1fr;
  }

  .home-data-families {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .home-topbar {
    height: 72px;
    padding: 0 17px;
  }

  .home-nav > a:not(.home-nav-primary) {
    display: none;
  }

  .home-main {
    padding: 16px 12px 54px;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    margin-bottom: 62px;
    padding: 42px 25px 310px;
    border-radius: 22px 22px 70px 22px;
  }

  .home-hero h2 {
    font-size: clamp(36px, 11vw, 52px);
  }

  .home-hero-visual {
    position: absolute;
    right: 13px;
    bottom: 15px;
    left: 13px;
    min-height: 270px;
  }

  .home-map-sheet {
    inset: 15px 38px 25px 35px;
  }

  .home-visual-note {
    right: 0;
  }

  .home-section-heading,
  .home-data-heading {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .home-grid,
  .home-data-families {
    grid-template-columns: 1fr;
  }

  .home-card {
    min-height: 320px;
  }

  .home-data {
    padding: 25px 15px;
    border-radius: 21px;
  }

  .home-data-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-family-heading,
  .home-footer {
    display: grid;
  }

  .home-data-notice {
    grid-template-columns: 1fr;
  }

  .home-data-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .home-brand p,
  .home-footer p {
    display: none;
  }

  .home-nav .home-nav-primary {
    padding: 9px 13px;
  }

  .home-hero-proof {
    gap: 10px;
  }

  .home-data-stats {
    grid-template-columns: 1fr;
  }

  .home-data-stat {
    min-height: 116px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero,
  .home-card,
  .home-data-stat,
  .home-data-family {
    animation: none;
  }
}

/* Client-facing vectorizer workspace */
.vectorizer-page {
  --vec-ink: #0d3735;
  --vec-ink-deep: #082a2a;
  --vec-paper: #f5f2ea;
  --vec-panel: #fffdf8;
  --vec-clay: #ce5a43;
  --vec-gold: #c89244;
  --vec-line: rgba(18, 58, 55, .14);
  background:
    radial-gradient(circle at 8% 12%, rgba(206,90,67,.07), transparent 25rem),
    linear-gradient(145deg, #f6f3ec, #eaece6);
  color: #173230;
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

.vectorizer-page .vectorizer-topbar {
  position: relative;
  z-index: 20;
  height: 76px;
  padding: 0 24px;
  border-bottom: 0;
  color: #f8f4e9;
  background:
    linear-gradient(120deg, rgba(255,255,255,.035) 0 1px, transparent 1px 84px),
    linear-gradient(135deg, #0b3533, #082829);
  box-shadow: 0 10px 30px rgba(8,42,42,.16);
}

.vectorizer-page .brand .mark {
  width: 45px;
  height: 45px;
  border-color: rgba(255,255,255,.26);
  border-radius: 15px 9px 15px 9px;
  color: #f9f3e6;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  font-family: Georgia, serif;
  letter-spacing: .06em;
}

.vectorizer-page .brand h1 {
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 19px;
}

.vectorizer-page .brand p {
  color: rgba(255,255,255,.53);
  letter-spacing: .04em;
}

.vectorizer-page .nav-link {
  border-color: rgba(255,255,255,.15);
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.055);
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.vectorizer-page .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.vectorizer-page .status-pill {
  position: relative;
  padding-left: 25px;
  border-color: rgba(143,185,168,.3);
  color: #bcd8cc;
  background: rgba(143,185,168,.09);
}

.vectorizer-page .status-pill::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ec7a6;
  box-shadow: 0 0 0 4px rgba(126,199,166,.11);
  transform: translateY(-50%);
}

.vectorizer-page .vectorizer-app {
  height: calc(100vh - 76px);
  grid-template-columns: 334px minmax(460px, 1fr) 306px;
  gap: 14px;
  padding: 14px;
}

.vectorizer-page .panel {
  border-color: var(--vec-line);
  border-radius: 16px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 18px 46px rgba(28,55,51,.09);
}

.vectorizer-sidebar,
.vectorizer-inspector {
  scrollbar-width: thin;
  scrollbar-color: rgba(13,55,53,.2) transparent;
  animation: vectorizer-panel-in .45s cubic-bezier(.2,.8,.2,1) both;
}

.vectorizer-inspector {
  animation-delay: 80ms;
}

.vectorizer-page .control-block {
  padding: 17px;
  border-bottom-color: rgba(18,58,55,.1);
}

.vectorizer-control-title {
  margin-bottom: 13px;
}

.vectorizer-control-title span {
  display: block;
  margin-bottom: 4px;
  color: var(--vec-clay);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

.vectorizer-page .vectorizer-control-title h2 {
  margin: 0;
  color: var(--vec-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 17px;
}

.vectorizer-page .upload-box {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  border: 1px dashed rgba(13,55,53,.38);
  border-radius: 13px;
  color: #34524e;
  background:
    radial-gradient(circle at 82% 10%, rgba(206,90,67,.09), transparent 6rem),
    linear-gradient(145deg, #f7f6f0, #edf1eb);
  font-weight: 800;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.vectorizer-page .upload-box::before {
  content: "+";
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0 auto -23px;
  border-radius: 50%;
  color: #f7f3e8;
  background: var(--vec-ink);
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 400;
  box-shadow: 0 8px 16px rgba(13,55,53,.17);
}

.vectorizer-page .upload-box:hover {
  border-color: var(--vec-clay);
  box-shadow: 0 10px 24px rgba(35,63,58,.09);
  transform: translateY(-2px);
}

.vectorizer-help {
  display: block;
  margin-top: 9px;
  color: #81908d;
  font-size: 10px;
  line-height: 1.55;
}

.vectorizer-page .segmented {
  gap: 3px;
  padding: 4px;
  border-color: rgba(18,58,55,.12);
  border-radius: 11px;
  background: #ebece6;
}

.vectorizer-page .segmented span {
  border-radius: 8px;
  font-size: 11px;
}

.vectorizer-page .segmented input:checked + span {
  color: var(--vec-ink);
  background: #fffdf8;
  box-shadow: 0 4px 12px rgba(18,58,55,.1);
}

.vectorizer-page .upload-progress,
.vectorizer-page .manual-roi-panel {
  border-color: var(--vec-line);
}

.vectorizer-page .upload-progress-bar {
  background: linear-gradient(90deg, var(--vec-ink), #2a8279);
}

.vectorizer-page .task-list {
  gap: 9px;
}

.vectorizer-page .task-row {
  position: relative;
  overflow: hidden;
  padding: 11px 11px 11px 14px;
  border-color: rgba(18,58,55,.11);
  border-radius: 11px;
  background: #f7f6f1;
  transition: border-color .18s ease, background .18s ease;
}

.vectorizer-page .task-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #c7d0ca;
}

.vectorizer-page .task-row:has(input:checked) {
  border-color: rgba(13,55,53,.28);
  background: #f0f4ee;
}

.vectorizer-page .task-row:has(input:checked)::before {
  background: var(--vec-clay);
}

.vectorizer-page .task-head {
  margin-bottom: 7px;
}

.vectorizer-page .task-head label {
  color: #294743;
  font-size: 12px;
}

.vectorizer-page .task-head input,
.vectorizer-page .layer-control input[type="checkbox"] {
  accent-color: var(--vec-clay);
}

.vectorizer-page select,
.vectorizer-page .field input,
.vectorizer-page .roi-fields input {
  border-color: rgba(18,58,55,.14);
  border-radius: 9px;
  color: #294541;
  background: #fffdf9;
}

.vectorizer-page .primary {
  min-height: 49px;
  border-radius: 12px;
  background: linear-gradient(110deg, var(--vec-ink), #185d58);
  box-shadow: 0 12px 24px rgba(13,55,53,.2);
  letter-spacing: .05em;
  transition: transform .18s ease, box-shadow .18s ease;
}

.vectorizer-page .primary:not(:disabled):hover {
  box-shadow: 0 16px 30px rgba(13,55,53,.27);
  transform: translateY(-2px);
}

.vectorizer-page .result-block {
  background: linear-gradient(180deg, rgba(13,55,53,.025), transparent);
}

.vectorizer-page .downloads a {
  border-color: rgba(18,58,55,.12);
  border-radius: 9px;
  color: #285c56;
  background: #f4f5ef;
}

.vectorizer-page .downloads a:hover {
  border-color: rgba(13,55,53,.3);
  background: #edf3ec;
}

.vectorizer-workspace {
  animation: vectorizer-panel-in .5s 40ms cubic-bezier(.2,.8,.2,1) both;
}

.vectorizer-page .viewer-toolbar {
  min-height: 68px;
  padding: 10px 13px;
  border-bottom-color: rgba(18,58,55,.11);
  background: rgba(252,250,245,.94);
}

.vectorizer-canvas-title {
  display: grid;
  gap: 3px;
  margin-right: auto;
}

.vectorizer-canvas-title span {
  color: var(--vec-clay);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .17em;
}

.vectorizer-canvas-title strong {
  color: var(--vec-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 15px;
}

.vectorizer-page .tabs {
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(18,58,55,.11);
  border-radius: 11px;
  background: #ebece6;
}

.vectorizer-page .tab {
  min-width: auto;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #6b7b78;
  background: transparent;
  font-size: 11px;
}

.vectorizer-page .tab.active {
  color: var(--vec-ink);
  background: #fffdf8;
  box-shadow: 0 3px 10px rgba(18,58,55,.1);
}

.vectorizer-page .zoom-tools {
  gap: 4px;
}

.vectorizer-page .zoom-tools button {
  border-color: rgba(18,58,55,.13);
  border-radius: 9px;
  color: #38534f;
  background: #fffdf8;
}

.vectorizer-page .viewer {
  background-color: #dfe5df;
  background-image: radial-gradient(rgba(13,55,53,.14) .7px, transparent .7px);
  background-size: 15px 15px;
}

.vectorizer-page .stack {
  border: 7px solid #f8f5ed;
  border-radius: 3px;
  box-shadow: 0 22px 50px rgba(20,48,45,.22);
}

.vectorizer-page .empty-state {
  gap: 10px;
  color: #7b8986;
}

.vectorizer-page .empty-state strong {
  color: #34514d;
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 19px;
}

.vectorizer-page .empty-state span {
  max-width: 330px;
  line-height: 1.6;
}

.vectorizer-empty-symbol {
  position: relative;
  width: 84px;
  height: 66px;
  margin: 0 auto 7px;
}

.vectorizer-empty-symbol i {
  position: absolute;
  width: 64px;
  height: 42px;
  border: 1px solid rgba(13,55,53,.25);
  border-radius: 50% 44% 56% 46%;
}

.vectorizer-empty-symbol i:nth-child(1) { left: 0; top: 14px; transform: rotate(16deg); }
.vectorizer-empty-symbol i:nth-child(2) { right: 0; top: 4px; transform: rotate(-18deg); }
.vectorizer-empty-symbol i:nth-child(3) { left: 13px; bottom: 0; border-color: rgba(206,90,67,.4); transform: rotate(-4deg); }

.vectorizer-page .layer-controls {
  gap: 9px;
}

.vectorizer-page .layer-control {
  padding: 11px;
  border-color: rgba(18,58,55,.12);
  border-radius: 11px;
  background: #f6f5ef;
}

.vectorizer-page .layer-control header span {
  color: #2e4a46;
}

.vectorizer-page .method-badge,
.vectorizer-page .qa-badge {
  border-radius: 999px;
}

.vectorizer-page .summary {
  max-height: 420px;
  border: 0;
  border-radius: 12px;
  color: #cee0d9;
  background:
    linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 22px),
    #0a302f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

@keyframes vectorizer-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .vectorizer-page .vectorizer-app {
    grid-template-columns: 300px minmax(430px, 1fr);
  }

  .vectorizer-inspector {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 390px;
  }
}

@media (max-width: 820px) {
  .vectorizer-page .vectorizer-topbar {
    height: auto;
    min-height: 72px;
    padding: 10px 14px;
  }

  .vectorizer-page .top-actions .nav-link:not(:first-child) {
    display: none;
  }

  .vectorizer-page .status-pill {
    display: none;
  }

  .vectorizer-page .vectorizer-app {
    height: auto;
    min-height: calc(100vh - 72px);
    grid-template-columns: 1fr;
    padding: 9px;
  }

  .vectorizer-workspace {
    min-height: 72vh;
  }

  .vectorizer-inspector {
    display: block;
    max-height: none;
  }

  .vectorizer-page .viewer-toolbar {
    flex-wrap: wrap;
  }

  .vectorizer-canvas-title {
    width: 100%;
  }

  .vectorizer-page .tabs {
    flex: 1;
  }

  .vectorizer-page .tab {
    flex: 1;
    padding: 0 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vectorizer-sidebar,
  .vectorizer-inspector,
  .vectorizer-workspace {
    animation: none;
  }
}

.vectorizer-processing {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,253,248,.94), rgba(229,235,228,.9) 62%, rgba(210,221,214,.92)),
    radial-gradient(rgba(13,55,53,.14) .7px, transparent .7px);
  background-size: auto, 15px 15px;
  backdrop-filter: blur(6px);
}

.vectorizer-processing-card {
  width: min(570px, 94%);
  padding: 28px;
  border: 1px solid rgba(13,55,53,.15);
  border-radius: 19px;
  background: rgba(255,253,248,.95);
  box-shadow: 0 28px 70px rgba(13,55,53,.17);
  animation: vectorizer-processing-in .3s ease both;
}

.vectorizer-processing-head {
  display: grid;
  grid-template-columns: 55px 1fr auto;
  gap: 14px;
  align-items: center;
}

.vectorizer-processing-symbol {
  position: relative;
  width: 55px;
  height: 55px;
  border-radius: 18px 11px 18px 11px;
  background: var(--vec-ink);
  box-shadow: 0 12px 25px rgba(13,55,53,.2);
}

.vectorizer-processing-symbol i {
  position: absolute;
  width: 27px;
  height: 17px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 50% 44% 57% 43%;
  animation: processing-contour 1.8s ease-in-out infinite;
}

.vectorizer-processing-symbol i:nth-child(1) { left: 7px; top: 9px; transform: rotate(15deg); }
.vectorizer-processing-symbol i:nth-child(2) { right: 6px; top: 19px; animation-delay: .2s; transform: rotate(-15deg); }
.vectorizer-processing-symbol i:nth-child(3) { left: 13px; bottom: 7px; border-color: #e4ae66; animation-delay: .4s; }

.vectorizer-processing-head > div:nth-child(2) {
  display: grid;
  gap: 4px;
}

.vectorizer-processing-head span {
  color: var(--vec-clay);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .17em;
}

.vectorizer-processing-head strong {
  color: var(--vec-ink-deep);
  font-family: "Noto Serif CJK SC", "Songti SC", STSong, serif;
  font-size: 20px;
}

.vectorizer-processing-head > b {
  color: var(--vec-ink);
  font-family: Georgia, serif;
  font-size: 30px;
  letter-spacing: -.04em;
}

.vectorizer-processing-track {
  height: 8px;
  overflow: hidden;
  margin: 23px 0 12px;
  border-radius: 999px;
  background: #e1e6df;
}

.vectorizer-processing-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--vec-ink), #2b8178 72%, #d09a4b);
  box-shadow: 0 0 16px rgba(43,129,120,.24);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}

.vectorizer-processing-card > p {
  min-height: 22px;
  margin: 0;
  color: #677874;
  line-height: 1.6;
}

.vectorizer-processing-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 23px 0 18px;
  padding: 0;
  list-style: none;
}

.vectorizer-processing-steps::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 8%;
  left: 8%;
  height: 1px;
  background: #d9dfd8;
}

.vectorizer-processing-steps li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #9aa5a1;
  font-size: 9px;
  text-align: center;
}

.vectorizer-processing-steps i {
  width: 15px;
  height: 15px;
  border: 3px solid #fdfbf6;
  border-radius: 50%;
  background: #cbd3cd;
  box-shadow: 0 0 0 1px #cbd3cd;
}

.vectorizer-processing-steps li.active {
  color: var(--vec-clay);
  font-weight: 900;
}

.vectorizer-processing-steps li.active i {
  background: var(--vec-clay);
  box-shadow: 0 0 0 1px var(--vec-clay), 0 0 0 5px rgba(206,90,67,.1);
}

.vectorizer-processing-steps li.done {
  color: var(--vec-ink);
}

.vectorizer-processing-steps li.done i {
  background: var(--vec-ink);
  box-shadow: 0 0 0 1px var(--vec-ink);
}

.vectorizer-processing-card > small {
  display: block;
  padding-top: 13px;
  border-top: 1px solid rgba(13,55,53,.1);
  color: #899692;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.vectorizer-processing.is-error .vectorizer-processing-symbol,
.vectorizer-processing.is-error .vectorizer-processing-track span {
  background: #ad4034;
}

.vectorizer-processing.is-error .vectorizer-processing-head span,
.vectorizer-processing.is-error .vectorizer-processing-head > b {
  color: #ad4034;
}

@keyframes vectorizer-processing-in {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes processing-contour {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

@media (max-width: 640px) {
  .vectorizer-processing {
    padding: 12px;
  }

  .vectorizer-processing-card {
    padding: 20px 16px;
  }

  .vectorizer-processing-head {
    grid-template-columns: 48px 1fr auto;
    gap: 9px;
  }

  .vectorizer-processing-symbol {
    width: 48px;
    height: 48px;
  }

  .vectorizer-processing-head strong {
    font-size: 16px;
  }

  .vectorizer-processing-head > b {
    font-size: 23px;
  }
}
.selectable-svg-export {
  display: grid;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 13px;
  border: 1px solid #b8c6bd;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(236, 246, 239, 0.96), rgba(250, 248, 237, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(27, 84, 58, 0.04) 19px 20px);
}

.selectable-svg-export-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
}

.selectable-svg-export-head div {
  display: grid;
  gap: 2px;
}

.selectable-svg-export-head span {
  color: #48705a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.selectable-svg-export-head strong {
  color: #183b2a;
  font-size: 15px;
}

.selectable-svg-export-head small,
.selectable-svg-export > p {
  color: #65746b;
  font-size: 11px;
  line-height: 1.5;
}

.selectable-svg-export > p {
  margin: 0;
}

.selectable-svg-export-layers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.selectable-svg-export-layers label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 7px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #cad5cd;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.selectable-svg-export-layers label > span {
  overflow: hidden;
  color: #263e31;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selectable-svg-export-layers label > i {
  grid-column: 2;
  color: #568063;
  font-size: 9px;
  font-style: normal;
}

.selectable-svg-export-layers label.is-review > i {
  color: #a16324;
}

.selectable-svg-export-button {
  min-height: 38px;
  border: 1px solid #164c32;
  border-radius: 8px;
  background: #183f2c;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.selectable-svg-export-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.selectable-svg-export-status {
  min-height: 16px;
  color: #51695b;
  font-size: 10px;
  line-height: 1.5;
}

.selectable-svg-export-status.is-success { color: #17623a; }
.selectable-svg-export-status.is-error { color: #a63f32; }
/* Unified client-facing tool pages: legend VLM and super-resolution. */
.tool-page {
  --tool-paper: #f1eee5;
  --tool-card: rgba(255, 253, 247, 0.94);
  --tool-ink: #17231f;
  --tool-green: #214f43;
  --tool-green-soft: #dce8e1;
  --tool-coral: #c95435;
  --tool-line: rgba(30, 55, 47, 0.15);
  min-height: 100vh;
  color: var(--tool-ink);
  background:
    radial-gradient(circle at 9% 18%, rgba(201, 84, 53, 0.09), transparent 24rem),
    radial-gradient(circle at 86% 82%, rgba(33, 79, 67, 0.10), transparent 30rem),
    linear-gradient(rgba(33, 79, 67, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 79, 67, 0.025) 1px, transparent 1px),
    var(--tool-paper);
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
  font-family: "Aptos", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.tool-page .tool-topbar {
  height: 78px;
  padding: 0 28px;
  border-bottom: 1px solid var(--tool-line);
  background: rgba(247, 244, 236, 0.9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 80;
}

.tool-page .tool-brand {
  color: inherit;
  text-decoration: none;
}

.tool-page .tool-brand .mark {
  width: 43px;
  height: 43px;
  border-radius: 13px 5px 13px 5px;
  display: grid;
  place-items: center;
  color: #fffdf7;
  background: var(--tool-green);
  box-shadow: 7px 7px 0 rgba(201, 84, 53, 0.16);
  font-family: "Aptos Display", "Noto Sans SC", sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.tool-page .tool-brand h1 {
  color: var(--tool-ink);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.tool-page .tool-brand p {
  color: #66756e;
  letter-spacing: 0.08em;
}

.tool-page .tool-nav {
  gap: 5px;
}

.tool-page .tool-nav .nav-link {
  border-color: transparent;
  border-radius: 999px;
  padding: 8px 13px;
  color: #52645d;
  background: transparent;
}

.tool-page .tool-nav .nav-link:hover,
.tool-page .tool-nav .nav-link.is-active {
  color: #fffdf8;
  background: var(--tool-green);
  border-color: var(--tool-green);
}

.tool-page .status-pill {
  margin-left: 8px;
  border-color: rgba(33, 79, 67, 0.22);
  color: var(--tool-green);
  background: var(--tool-green-soft);
}

.tool-page .status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #3d8d70;
  box-shadow: 0 0 0 4px rgba(61, 141, 112, 0.12);
}

.tool-page .tool-shell {
  min-height: calc(100vh - 78px);
  height: calc(100vh - 78px);
  gap: 18px;
  padding: 18px;
}

.tool-page .panel {
  border: 1px solid rgba(33, 79, 67, 0.14);
  border-radius: 20px;
  background: var(--tool-card);
  box-shadow: 0 18px 45px rgba(28, 48, 41, 0.08);
}

.tool-page .tool-sidebar {
  border-top: 4px solid var(--tool-coral);
  overflow: auto;
  scrollbar-width: thin;
}

.tool-page .tool-intro {
  padding: 6px 2px 18px;
  border-bottom: 1px solid var(--tool-line);
  margin-bottom: 16px;
}

.legend-page .tool-intro {
  margin: 18px 18px 4px;
  padding: 4px 0 18px;
}

.tool-page .tool-intro > span,
.tool-page .legend-toolbar small,
.tool-page .tool-workspace-head small {
  display: block;
  margin-bottom: 7px;
  color: var(--tool-coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.tool-page .tool-intro h2 {
  margin: 0;
  color: var(--tool-ink);
  font-family: "Aptos Display", "Noto Serif SC", serif;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.tool-page .tool-intro p {
  margin: 9px 0 0;
  color: #65736d;
  font-size: 13px;
  line-height: 1.65;
}

.tool-page .tool-control {
  position: relative;
  padding-top: 14px;
}

.tool-page .tool-control::before {
  content: attr(data-step);
  position: absolute;
  top: 14px;
  right: 0;
  color: rgba(33, 79, 67, 0.34);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tool-page .control-block h2,
.tool-page .superres-field > span {
  color: #293b34;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.tool-page select,
.tool-page input[type="number"] {
  min-height: 42px;
  border-color: rgba(33, 79, 67, 0.19);
  border-radius: 10px;
  color: var(--tool-ink);
  background: rgba(255, 255, 255, 0.78);
}

.tool-page select:focus,
.tool-page input:focus {
  outline: 3px solid rgba(201, 84, 53, 0.13);
  border-color: var(--tool-coral);
}

.tool-page .upload-box,
.tool-page .superres-dropzone {
  min-height: 118px;
  border: 1px dashed rgba(33, 79, 67, 0.38);
  border-radius: 15px;
  color: var(--tool-green);
  background:
    linear-gradient(135deg, rgba(33, 79, 67, 0.07), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(33, 79, 67, 0.025) 8px, rgba(33, 79, 67, 0.025) 9px);
}

.tool-page .upload-box:hover,
.tool-page .superres-dropzone:hover {
  border-color: var(--tool-coral);
  transform: translateY(-1px);
}

.tool-page button.primary,
.tool-page .primary {
  min-height: 46px;
  border-radius: 12px;
  color: #fffdf8;
  background: var(--tool-green);
  box-shadow: 0 10px 20px rgba(33, 79, 67, 0.18);
}

.tool-page button.primary:hover,
.tool-page .primary:hover {
  background: #173c33;
  transform: translateY(-1px);
}

.tool-page .tool-workspace {
  overflow: hidden;
  border-top: 4px solid var(--tool-green);
}

.tool-page .legend-toolbar,
.tool-page .tool-workspace-head,
.tool-page .superres-result-head {
  min-height: 68px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--tool-line);
  background: rgba(246, 244, 237, 0.88);
}

.tool-page .legend-toolbar > div,
.tool-page .tool-workspace-head > div {
  display: grid;
}

.tool-page .legend-toolbar strong,
.tool-page .tool-workspace-head strong {
  color: var(--tool-ink);
  font-size: 16px;
}

.tool-page .tool-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-page .tool-workspace-head > span {
  color: #718079;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.tool-page .legend-result-layout {
  background: rgba(255, 255, 255, 0.38);
}

.tool-page .legend-preview {
  border-right-color: var(--tool-line);
}

.tool-page .legend-preview h2,
.tool-page .legend-table-wrap h2 {
  color: var(--tool-green);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tool-page .legend-image-scroll,
.tool-page .legend-sheet-scroll,
.tool-page .legend-item-card,
.tool-page .superres-compare-stage,
.tool-page .superres-zoom-panel {
  border-color: rgba(33, 79, 67, 0.15);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(30, 50, 43, 0.05);
}

.tool-page .legend-item-card {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.tool-page .legend-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 28px rgba(30, 50, 43, 0.09);
}

.tool-page .legend-selection-rect {
  border-color: var(--tool-coral);
  background: rgba(201, 84, 53, 0.10);
  box-shadow: 0 0 0 9999px rgba(18, 31, 27, 0.16);
}

.tool-page.superres-page .superres-app {
  grid-template-columns: 348px minmax(0, 1fr);
}

.tool-page .superres-controls {
  padding: 18px;
  gap: 14px;
}

.tool-page .superres-field {
  padding: 12px;
  border: 1px solid rgba(33, 79, 67, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
}

.tool-page .superres-field small {
  color: #718079;
  line-height: 1.5;
}

.tool-page .superres-workspace {
  display: grid;
  grid-template-rows: auto 1fr;
}

.tool-page .superres-empty,
.tool-page .superres-busy {
  min-height: 0;
  height: auto;
  margin: 18px;
  border: 1px dashed rgba(33, 79, 67, 0.25);
  border-radius: 15px;
  color: #66766f;
  background:
    radial-gradient(circle at 50% 42%, rgba(33, 79, 67, 0.09), transparent 13rem),
    rgba(255, 255, 255, 0.35);
}

.tool-page .superres-empty strong,
.tool-page .superres-busy strong {
  color: var(--tool-green);
  font-size: 20px;
}

.tool-page .superres-result {
  min-height: 0;
  overflow: auto;
}

.tool-page .superres-result-head h2 {
  color: var(--tool-ink);
  font-family: "Aptos Display", "Noto Serif SC", serif;
}

.tool-page .superres-result-head .nav-link {
  border-radius: 999px;
  border-color: var(--tool-green);
  color: var(--tool-green);
  background: transparent;
}

.tool-page .superres-result-head .nav-link:last-child {
  color: #fff;
  background: var(--tool-green);
}

.tool-page .superres-handle {
  background: var(--tool-coral);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.88), 0 5px 16px rgba(0, 0, 0, 0.22);
}

@media (max-width: 1040px) {
  .tool-page .tool-shell,
  .tool-page.superres-page .superres-app {
    height: auto;
    min-height: calc(100vh - 78px);
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .tool-page .tool-sidebar,
  .tool-page .tool-workspace {
    overflow: visible;
  }

  .tool-page .legend-result-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .tool-page .legend-preview {
    border-right: 0;
    border-bottom: 1px solid var(--tool-line);
  }
}

@media (max-width: 720px) {
  .tool-page .tool-topbar {
    height: auto;
    min-height: 72px;
    padding: 11px 14px;
    align-items: flex-start;
  }

  .tool-page .tool-brand p,
  .tool-page .status-pill,
  .tool-page .tool-nav .nav-link:first-child {
    display: none;
  }

  .tool-page .tool-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .tool-page .tool-nav .nav-link {
    padding: 7px 9px;
    font-size: 11px;
  }

  .tool-page .tool-shell {
    padding: 10px;
    gap: 10px;
  }

  .tool-page .legend-preview-grid,
  .tool-page .superres-zoom-grid {
    grid-template-columns: 1fr;
  }

  .tool-page .legend-item-card {
    grid-template-columns: 1fr;
  }

  .tool-page .tool-workspace-head > span {
    display: none;
  }
}
.tool-page .superres-field {
  position: relative;
}

.tool-page .superres-label-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tool-page .superres-help-button {
  width: 19px;
  height: 19px;
  min-height: 0;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(33, 79, 67, 0.38);
  border-radius: 50%;
  color: var(--tool-green);
  background: #fffdf8;
  box-shadow: none;
  font: 800 11px/1 "Aptos", sans-serif;
  cursor: pointer;
}

.tool-page .superres-help-button:hover,
.tool-page .superres-help-button[aria-expanded="true"] {
  color: #fff;
  border-color: var(--tool-coral);
  background: var(--tool-coral);
  transform: none;
}

.tool-page .superres-help-popover {
  position: absolute;
  z-index: 30;
  top: 42px;
  left: 10px;
  right: 10px;
  display: block;
  padding: 13px 14px;
  border: 1px solid rgba(33, 79, 67, 0.19);
  border-radius: 12px;
  color: #53645d;
  background: #fffef9;
  box-shadow: 0 15px 35px rgba(24, 43, 36, 0.18);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
}

.tool-page .superres-help-popover[hidden] {
  display: none;
}

.tool-page .superres-help-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 48px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(33, 79, 67, 0.19);
  border-left: 1px solid rgba(33, 79, 67, 0.19);
  background: #fffef9;
  transform: rotate(45deg);
}

.tool-page .superres-help-popover strong {
  display: block;
  margin-bottom: 4px;
  color: var(--tool-green);
  font-size: 12px;
}

.tool-page .superres-help-popover b {
  color: #293b34;
}
.vectorizer-pre-superres {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(33, 79, 67, 0.16);
  border-radius: 12px;
  color: #213a32;
  background: linear-gradient(135deg, rgba(33, 79, 67, 0.08), rgba(255, 255, 255, 0.82));
  cursor: pointer;
}

.vectorizer-pre-superres input {
  width: 18px;
  height: 18px;
  accent-color: #214f43;
}

.vectorizer-pre-superres span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.vectorizer-pre-superres strong {
  font-size: 13px;
}

.vectorizer-pre-superres small {
  color: #6a7a73;
  font-size: 11px;
  line-height: 1.4;
}

.vectorizer-pre-superres > i {
  padding: 3px 7px;
  border-radius: 999px;
  color: #a7472f;
  background: rgba(201, 84, 53, 0.11);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.vectorizer-pre-superres:has(input:checked) {
  border-color: rgba(33, 79, 67, 0.42);
  box-shadow: inset 3px 0 0 #214f43;
}
