@font-face {
  font-family: "LMRomanDemi10";
  font-style: normal;
  font-weight: 400;
  src: url("/static/fonts/LMRomanDemi10-Regular.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "LMRomanDemi10";
  font-style: italic;
  font-weight: 400;
  src: url("/static/fonts/LMRomanDemi10-Oblique.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f5f4;
  --ink: #172027;
  --ink-2: #27323b;
  --muted: #65717a;
  --line: #d9dfdc;
  --blue: #2f6380;
  --green: #0d766d;
  --green-2: #115e59;
  --red: #b85235;
  --gold: #be8b24;
  --review-blue: #1f7fa8;
  --page-max: 1320px;
  --narrow-max: 1160px;
  --page-gutter: clamp(40px, 10vw, 144px);
  --shadow: 0 18px 46px rgba(26, 39, 45, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "LMRomanDemi10", ui-serif, Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

::selection {
  background: rgba(13, 118, 109, 0.18);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 10px max(24px, calc((100vw - var(--page-max)) / 2));
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(32, 40, 45, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brand strong {
  font-style: italic;
  font-weight: 400;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
}

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

.dev-mode-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(184, 82, 53, 0.38);
  border-radius: 999px;
  background: rgba(184, 82, 53, 0.08);
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.dataset-cover {
  position: relative;
  min-height: clamp(280px, 24vw, 400px);
  overflow: hidden;
  background: #0b1212;
  border-bottom: 1px solid rgba(218, 232, 228, 0.16);
}

.dataset-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dataset-cover-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  width: min(1560px, calc(100% - 64px));
  min-height: clamp(280px, 24vw, 400px);
  margin-left: max(32px, calc((100vw - 1720px) / 2));
  padding: clamp(120px, 8.5vw, 160px) 0;
  pointer-events: none;
}

.dataset-cover-content h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 4vw, 64px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.92;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.52);
}

.hero {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 30vh;
  overflow: hidden;
  background: #101719;
}

.hero-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.74;
  background:
    linear-gradient(115deg, rgba(16, 23, 25, 0.98), rgba(17, 94, 89, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 72px);
}

.hero-field span {
  position: absolute;
  display: block;
  border: 1px solid rgba(143, 224, 199, 0.32);
  border-radius: 999px;
  transform: rotate(-18deg);
}

.hero-field span:nth-child(1) {
  width: 420px;
  height: 420px;
  right: 12%;
  top: 14%;
}

.hero-field span:nth-child(2) {
  width: 620px;
  height: 180px;
  right: -80px;
  top: 38%;
}

.hero-field span:nth-child(3) {
  width: 320px;
  height: 90px;
  right: 28%;
  bottom: 12%;
}

.hero-field span:nth-child(4) {
  width: 1px;
  height: 68%;
  right: 24%;
  top: 16%;
  background: rgba(143, 224, 199, 0.36);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 45%, rgba(143, 224, 199, 0.12), transparent 30%), rgba(8, 13, 16, 0.18);
}

.hero-content {
  position: relative;
  width: min(var(--narrow-max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  padding: clamp(32px, 6vh, 56px) 0 clamp(24px, 5vh, 42px);
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #8fe0c7;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(34px, 5vw, 58px);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 400;
  line-height: 1.05;
}

h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 400;
}

.hero-copy {
  max-width: 620px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.button.subtle {
  background: var(--surface-2);
}

.button.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.button.info {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button:disabled:hover {
  transform: none;
}

.section-heading {
  width: min(var(--narrow-max), calc(100% - var(--page-gutter)));
  margin: 0 auto 26px;
}

.stats-band,
.browser-shell,
.api-section {
  padding: clamp(46px, 8vw, 90px) 0;
}

.stats-grid,
.api-grid {
  width: min(var(--narrow-max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
}

.stats-band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.stat {
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 10px 26px rgba(26, 39, 45, 0.05);
}

.stat strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.category-panel {
  width: min(var(--narrow-max), calc(100% - var(--page-gutter)));
  margin: 16px auto 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 10px 26px rgba(26, 39, 45, 0.04);
}

.category-panel-head,
.category-panel-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.category-panel-actions {
  justify-content: flex-end;
}

.category-panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.category-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.category-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.category-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.category-rail:not(.is-expanded) .category-pill:nth-child(n+13) {
  display: none;
}

.category-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-main small {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.category-pill:hover,
.category-pill.is-active,
.category-main.is-active {
  border-color: rgba(13, 118, 109, 0.56);
  color: var(--ink);
}

.category-pill.is-active {
  background: rgba(13, 118, 109, 0.08);
}

.category-review-toggle {
  display: none;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffefa;
  color: transparent;
  cursor: pointer;
}

body.is-dev-mode .category-review-toggle {
  display: grid;
}

.category-review-toggle[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.stats-grid,
.category-panel,
.browser-head,
.workbench {
  width: min(1560px, calc(100% - 64px));
  margin-left: max(32px, calc((100vw - 1720px) / 2));
  margin-right: 0;
}

.browser-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.browser-head--count-only {
  justify-content: flex-end;
  margin-bottom: 20px;
}

.browser-count {
  color: var(--muted);
  font-weight: 700;
}

.citation-section {
  padding: clamp(56px, 8vw, 90px) 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.citation-content {
  width: min(var(--narrow-max), calc(100% - 64px));
  margin-inline: auto;
}

.citation-heading {
  margin-bottom: 34px;
}

.citation-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.citation-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.08;
}

.citation-code-wrap {
  position: relative;
}

.citation-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.citation-copy:hover,
.citation-copy:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.citation-copy:active {
  transform: translateY(1px);
}

.citation-copy.is-copied {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.citation-copy svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.citation-note {
  max-width: 900px;
  margin: -14px 0 18px;
  color: var(--muted);
  font-size: clamp(1rem, 1.08vw, 1.08rem);
  line-height: 1.55;
}

.citation {
  width: min(var(--narrow-max), 100%);
  margin: 0;
  overflow-x: auto;
  padding: 20px 66px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font: inherit;
  font-size: clamp(0.98rem, 1.02vw, 1.06rem);
  line-height: 1.62;
  white-space: pre-wrap;
}

.citation code {
  font: inherit;
}

.workbench {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(26, 39, 45, 0.06);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.review-filter {
  display: none;
}

body.is-dev-mode .review-filter {
  display: grid;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fffefa;
  color: var(--ink);
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.is-public-mode #reloadButton {
  display: none;
}

.object-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.object-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(26, 39, 45, 0.06);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.object-card:hover {
  border-color: rgba(13, 118, 109, 0.28);
  box-shadow: 0 18px 38px rgba(26, 39, 45, 0.1);
  transform: translateY(-1px);
}

.object-card.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 118, 109, 0.14), 0 18px 38px rgba(26, 39, 45, 0.1);
}

.object-card.is-approved {
  border-color: rgba(13, 118, 109, 0.66);
  box-shadow: 0 0 0 3px rgba(13, 118, 109, 0.16), 0 10px 26px rgba(26, 39, 45, 0.06);
}

.object-card.is-rejected {
  border-color: rgba(184, 82, 53, 0.54);
}

.object-card.is-size-issue {
  box-shadow: 0 0 0 3px rgba(190, 139, 36, 0.16), 0 10px 26px rgba(26, 39, 45, 0.06);
}

.object-card.is-salvageable {
  box-shadow: 0 0 0 3px rgba(47, 99, 128, 0.18), 0 10px 26px rgba(26, 39, 45, 0.06);
}

.object-card.is-review-problem {
  border-color: rgba(184, 82, 53, 0.42);
}

.object-card button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.object-card .object-review-toggle,
.object-card .object-size-toggle,
.object-card .object-salvage-toggle,
.object-card .object-approved-toggle {
  position: absolute;
  top: 8px;
  z-index: 4;
  display: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 254, 250, 0.92);
  color: var(--muted);
  font-size: 0;
  line-height: 1;
  text-align: center;
  box-shadow: 0 7px 18px rgba(26, 39, 45, 0.14);
}

.object-card .object-approved-toggle {
  right: 116px;
  border-color: rgba(13, 118, 109, 0.58);
  color: var(--green);
}

.object-card .object-review-toggle {
  right: 8px;
  border-color: rgba(184, 82, 53, 0.58);
  color: var(--red);
}

.object-card .object-size-toggle {
  right: 44px;
  border-color: rgba(190, 139, 36, 0.66);
  color: var(--gold);
}

.object-card .object-salvage-toggle {
  right: 80px;
  border-color: rgba(31, 127, 168, 0.62);
  color: var(--review-blue);
}

.object-card .object-approved-toggle::before,
.object-card .object-review-toggle::before {
  display: block;
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.object-card .object-approved-toggle::before {
  content: "✓";
  transform: translateY(-1px);
}

.object-card .object-review-toggle::before {
  content: "×";
  font-size: 22px;
  transform: translateY(-1px);
}

.object-card .object-size-toggle::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border: 3.5px solid currentColor;
  border-radius: 50%;
}

.object-card .object-salvage-toggle::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-top: -1px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 12px solid currentColor;
}

body.is-dev-mode .object-card .object-review-toggle,
body.is-dev-mode .object-card .object-size-toggle,
body.is-dev-mode .object-card .object-salvage-toggle,
body.is-dev-mode .object-card .object-approved-toggle {
  display: grid;
  place-items: center;
}

.object-card .object-review-toggle[aria-pressed="true"],
.object-card .object-size-toggle[aria-pressed="true"],
.object-card .object-salvage-toggle[aria-pressed="true"],
.object-card .object-approved-toggle[aria-pressed="true"] {
  border-width: 2px;
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(255, 254, 250, 0.9), 0 9px 22px rgba(26, 39, 45, 0.22);
}

.object-card .object-approved-toggle[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.object-card .object-review-toggle[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.object-card .object-size-toggle[aria-pressed="true"] {
  border-color: var(--gold);
  background: #f4c84a;
  color: #5e3f00;
}

.object-card .object-size-toggle[aria-pressed="true"]::before {
  width: 15px;
  height: 15px;
  border-width: 4px;
}

.object-card .object-salvage-toggle[aria-pressed="true"] {
  border-color: var(--review-blue);
  background: var(--review-blue);
  color: #fff;
}

.object-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 150px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(13, 118, 109, 0.08), rgba(47, 99, 128, 0.08)),
    repeating-linear-gradient(90deg, rgba(23, 32, 39, 0.06) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(23, 32, 39, 0.05) 0 1px, transparent 1px 28px),
    #f7f8f5;
}

.object-card.is-active .object-preview {
  border-bottom-color: rgba(13, 118, 109, 0.42);
}

.object-preview canvas,
.object-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.thumbnail-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border: 1px solid rgba(217, 225, 228, 0.88);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-preview.is-loading::after,
.object-preview[data-thumbnail-state="loading"]::after,
.object-preview[data-thumbnail-state="queued"]::after {
  position: absolute;
  inset: 34% 24%;
  border: 1px solid rgba(13, 118, 109, 0.28);
  border-radius: 999px;
  content: "";
  transform: rotate(-18deg);
}

.object-body {
  padding: 15px;
}

.object-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 850;
}

.object-title span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.object-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.fix-summary-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(13, 118, 109, 0.22);
  border-radius: 999px;
  background: rgba(13, 118, 109, 0.08);
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.review-issue-badge {
  display: inline-flex;
  max-width: 100%;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(184, 82, 53, 0.24);
  border-radius: 999px;
  background: rgba(184, 82, 53, 0.075);
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.review-issue-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

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

.page-select-control select {
  width: 78px;
  min-height: 40px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.page-select-control small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.detail-empty {
  width: min(var(--narrow-max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  color: var(--muted);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  width: min(var(--page-max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
}

.detail-drawer {
  position: fixed;
  top: 72px;
  right: 24px;
  bottom: 16px;
  z-index: 35;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, calc(100vw - 48px));
  padding: 16px 18px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 247, 0.98);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 28px));
  visibility: hidden;
  transition: transform 180ms ease, opacity 180ms ease, visibility 0s linear 180ms;
}

.detail-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
  transition: transform 180ms ease, opacity 180ms ease;
}

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

.drawer-top h2 {
  margin: 0;
  font-size: 26px;
  overflow-wrap: anywhere;
}

.drawer-top h2 span,
.drawer-top h2 small {
  display: block;
}

.detail-source {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.drawer-close {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.detail-drawer .detail-empty {
  width: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.detail-drawer .detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  width: auto;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.detail-drawer .viewer-panel,
.detail-drawer .detail-panel {
  min-height: 0;
  padding-right: 4px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.viewer-panel {
  min-width: 0;
}

.detail-viewer-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.detail-viewer-label small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-viewer-label.is-fixed {
  margin-top: 14px;
  color: var(--green);
}

.fixed-result-preview {
  margin-top: 12px;
}

.fixed-variant-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.fixed-variant-button {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(13, 118, 109, 0.24);
  border-radius: 6px;
  background: rgba(13, 118, 109, 0.06);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.fixed-variant-button:hover,
.fixed-variant-button.is-active {
  border-color: rgba(13, 118, 109, 0.54);
  background: var(--green);
  color: #fff;
}

.viewer {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101719;
}

.detail-drawer .viewer,
.detail-drawer .viewer canvas {
  height: clamp(440px, 54vh, 560px);
  min-height: 440px;
  background: #f7f8f5;
}

.detail-drawer .fixed-result-viewer,
.detail-drawer .fixed-result-viewer canvas {
  height: clamp(420px, 50vh, 520px);
  min-height: 420px;
}

.viewer canvas {
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: block;
}

.viewer.is-dragging-joint canvas {
  cursor: grabbing;
}

.viewer.is-explode-draggable canvas {
  cursor: grab;
}

.viewer.is-explode-draggable.is-dragging-exploded canvas {
  cursor: grabbing;
}

.offscreen-thumbnail-renderer {
  position: fixed;
  width: 720px;
  height: 540px;
  left: -10000px;
  top: 0;
  pointer-events: none;
  opacity: 0;
}

.viewer-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.9);
  color: var(--ink);
  font-size: 13px;
}

.viewer-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.detail-drawer .viewer-switches {
  gap: 8px 14px;
}

.detail-drawer .viewer-hint {
  flex: 1 0 100%;
  text-align: left;
}

.viewer-switches {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.viewer-secondary-controls {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--ink);
  white-space: nowrap;
}

.switch-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.switch-control:has(input:disabled) {
  color: var(--muted);
  opacity: 0.58;
}

.fix-item-button {
  min-height: 30px;
  padding: 5px 10px;
  border-color: rgba(47, 99, 128, 0.34);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.fix-item-button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.detail-give-up-button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
}

.fix-active-badge {
  padding: 5px 8px;
  border: 1px solid rgba(47, 99, 128, 0.28);
  border-radius: 999px;
  background: rgba(47, 99, 128, 0.08);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.fix-page-body {
  min-height: 100vh;
  overflow: hidden;
}

.fix-topbar {
  position: static;
}

.fix-load-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(460px, 40vw);
}

.fix-load-form input {
  width: 100%;
  height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fffefa;
  color: var(--ink);
}

.fix-load-form .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.fix-page {
  display: grid;
  grid-template-columns: minmax(480px, 0.9fr) minmax(540px, 1fr);
  gap: 8px;
  height: calc(100vh - 64px);
  padding: 8px;
  overflow: hidden;
}

.fix-page-panel,
.fix-viewer-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: 0 12px 30px rgba(26, 39, 45, 0.06);
}

.fix-page-panel {
  padding: 16px;
}

.fix-page-panel h1,
.fix-page-panel h2,
.fix-viewer-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.fix-page-panel h1 span {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-style: normal;
}

.fix-panel-body {
  margin-top: 14px;
}

.fix-viewer-panel {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr);
  padding: 8px;
  background: #f8faf9;
}

.fix-viewer-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.fix-main-viewer,
.fix-main-viewer canvas {
  min-height: 0;
  height: 100%;
}

.fix-main-viewer {
  border-radius: 8px;
  background: #f8faf9;
}

.fix-operation-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.fix-operation-panel {
  padding: 12px;
}

.fix-side-block {
  display: grid;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.fix-side-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.fix-side-block + .fix-side-block {
  margin-top: 4px;
}

.fix-side-block h3 {
  margin-bottom: 0;
}

.fix-step-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 2px;
}

.patch-step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.patch-step-toggle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(13, 118, 109, 0.38);
  border-radius: 6px;
  background: rgba(13, 118, 109, 0.08);
  color: var(--green);
  cursor: pointer;
}

.patch-step-toggle:hover {
  background: rgba(13, 118, 109, 0.14);
}

.patch-step-triangle {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--green);
  transform: translateX(1px);
  transition: transform 120ms ease;
}

.patch-step-block.is-expanded .patch-step-triangle {
  transform: rotate(90deg) translateX(1px);
}

.patch-step-panel[hidden],
.patch-add-group-panel[hidden] {
  display: none;
}

.patch-step-panel,
.patch-add-group-panel {
  margin-top: 2px;
}

.patch-step-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.patch-add-group-button {
  flex: 0 0 auto;
}

.patch-add-group-panel {
  overflow: visible;
  border: 1px solid rgba(13, 118, 109, 0.18);
  border-radius: 6px;
  background: #f8faf9;
}

.patch-add-group-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.patch-placement-card {
  overflow: hidden;
}

.patch-placement-target {
  display: grid;
  gap: 4px;
}

.patch-placement-target > span,
.patch-control-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.patch-placement-target > span {
  text-transform: uppercase;
}

.patch-placement-target select {
  width: 100%;
}

.patch-placement-summary {
  color: var(--muted);
  font-size: 12px;
}

.patch-placement-summary strong {
  color: var(--ink);
}

.patch-placement-point-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.patch-placement-point-status > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 250, 249, 0.88);
}

.patch-placement-point-status small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-placement-point-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.patch-placement-point-actions .button {
  width: 100%;
  min-width: 0;
}

.patch-placement-point-actions .button.is-active {
  border-color: rgba(13, 118, 109, 0.5);
  background: rgba(13, 118, 109, 0.12);
  color: var(--green);
}

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

.patch-placement-actions {
  display: flex;
  justify-content: flex-end;
}

.patch-placement-actions .button {
  width: auto;
  min-width: 92px;
}

.patch-placement-actions [data-patch-placement-save] {
  min-width: 124px;
}

.patch-regroup-section {
  gap: 10px;
}

.patch-regroup-preview-section {
  background: rgba(13, 118, 109, 0.04);
}

.patch-regroup-preview-section .joint-item {
  background: rgba(248, 250, 249, 0.94);
}

.patch-pose-control-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.patch-pose-target-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.patch-pose-target-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-pose-target-control select {
  width: 100%;
  min-width: 0;
}

.patch-pose-control-head .button {
  min-height: 34px;
  white-space: nowrap;
}

.patch-regroup-save-section {
  padding-top: 10px;
}

.patch-regroup-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.patch-regroup-controls label {
  display: grid;
  gap: 4px;
}

.patch-regroup-controls span,
.patch-regroup-controls small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-regroup-controls select {
  width: 100%;
}

.patch-regroup-current-target,
.patch-regroup-pending-summary {
  display: grid;
  grid-template-columns: 12px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 250, 249, 0.88);
}

.patch-regroup-current-target.has-target {
  border-color: rgba(13, 148, 136, 0.42);
  background: rgba(13, 148, 136, 0.08);
}

.patch-regroup-current-target > span:not(.patch-regroup-swatch),
.patch-regroup-current-target small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-regroup-current-target strong,
.patch-regroup-pending-summary > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-regroup-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.patch-regroup-swatch.is-target {
  background: #0d9488;
}

.patch-regroup-swatch.is-pending {
  background: #ff5a2f;
}

.patch-regroup-target-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.patch-regroup-target-controls label {
  display: grid;
  gap: 4px;
}

.patch-regroup-target-controls label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-regroup-target-controls select,
.patch-regroup-target-controls .button {
  width: 100%;
  min-height: 36px;
}

.patch-regroup-pending-summary {
  grid-template-columns: 12px auto minmax(0, 1fr);
}

.patch-regroup-pending-summary.has-pending {
  border-color: rgba(255, 90, 47, 0.42);
  background: rgba(255, 90, 47, 0.07);
}

.patch-regroup-pending-summary > span:last-child {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.patch-part-mode-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.patch-regroup-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.patch-regroup-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(13, 118, 109, 0.16);
  border-radius: 6px;
  background: rgba(13, 118, 109, 0.045);
}

.patch-regroup-mode-row .button,
.patch-regroup-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  white-space: nowrap;
}

.patch-regroup-mode-row .button {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.82);
}

.patch-regroup-mode-row .button.is-active {
  border-color: rgba(13, 118, 109, 0.48);
  background: rgba(13, 118, 109, 0.14);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.12);
}

.patch-contact-cut-section {
  display: grid;
  gap: 10px;
  background: rgba(198, 54, 32, 0.025);
}

.patch-cut-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
}

.patch-cut-summary span {
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid rgba(198, 54, 32, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-cut-summary strong {
  color: #9f2f20;
}

.patch-cut-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.patch-cut-mode-row .button {
  width: 100%;
  min-width: 0;
}

.fix-main-viewer.is-picking.is-cut-moving,
.fix-main-viewer.is-picking.is-cut-moving canvas {
  cursor: grab;
}

.fix-main-viewer.is-picking.is-cut-moving.is-cut-dragging,
.fix-main-viewer.is-picking.is-cut-moving.is-cut-dragging canvas {
  cursor: grabbing;
}

.patch-cut-inset-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 250, 249, 0.9);
}

.patch-cut-inset-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-cut-inset-control > strong {
  color: #9f2f20;
  font-size: 12px;
}

.patch-cut-inset-control input {
  grid-column: 1 / -1;
  width: 100%;
}

.patch-cut-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patch-face-section {
  display: grid;
  gap: 10px;
  background: rgba(47, 99, 128, 0.035);
}

.patch-face-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.patch-face-counts span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(47, 99, 128, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.patch-face-counts strong {
  color: var(--blue);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.patch-mesh-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 99, 128, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.patch-mesh-check .button {
  min-height: 34px;
  white-space: nowrap;
}

.patch-face-view-row,
.patch-face-mode-row,
.patch-face-actions {
  display: grid;
  gap: 8px;
}

.patch-face-view-row,
.patch-face-mode-row {
  padding: 4px;
  border: 1px solid rgba(47, 99, 128, 0.16);
  border-radius: 6px;
  background: rgba(47, 99, 128, 0.045);
}

.patch-face-view-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patch-face-mode-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.patch-face-view-row .button,
.patch-face-mode-row .button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.84);
  white-space: normal;
}

.patch-face-view-row .button.is-active,
.patch-face-mode-row .button.is-active {
  border-color: rgba(47, 99, 128, 0.48);
  background: rgba(47, 99, 128, 0.12);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(47, 99, 128, 0.1);
}

.patch-face-cluster {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(47, 99, 128, 0.16);
}

.patch-cluster-mode-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.viewer-area-selection {
  position: absolute;
  z-index: 1250;
  border: 2px solid rgba(47, 99, 128, 0.92);
  background: rgba(47, 99, 128, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.78) inset;
  pointer-events: none;
}

.fix-main-viewer.is-area-picking,
.fix-main-viewer.is-area-picking canvas,
.fix-main-viewer.is-area-dragging,
.fix-main-viewer.is-area-dragging canvas {
  cursor: crosshair;
}

.patch-cluster-mode-row .button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  white-space: normal;
}

.patch-cluster-mode-row .button.is-active {
  border-color: rgba(13, 118, 109, 0.48);
  background: rgba(13, 118, 109, 0.13);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.1);
}

.patch-cluster-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.patch-cluster-counts span {
  min-width: 0;
  padding: 6px 7px;
  border-left: 2px solid rgba(47, 99, 128, 0.2);
  background: rgba(255, 255, 255, 0.62);
}

.patch-cluster-counts strong {
  margin-right: 3px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.patch-cluster-report {
  display: grid;
  border-top: 1px solid rgba(47, 99, 128, 0.13);
}

.patch-cluster-report:empty {
  display: none;
}

.patch-cluster-report-label {
  padding: 7px 2px 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.patch-cluster-target,
.patch-cluster-distance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 6px 2px;
  border-bottom: 1px solid rgba(47, 99, 128, 0.1);
  color: var(--muted);
  font-size: 11px;
}

.patch-cluster-target strong,
.patch-cluster-distance-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.patch-face-assignment {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(47, 99, 128, 0.16);
}

.patch-face-assignment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
}

.patch-face-assignment-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.patch-face-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid rgba(47, 99, 128, 0.16);
  border-radius: 6px;
  background: rgba(47, 99, 128, 0.045);
}

.patch-face-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
}

.patch-face-target > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.patch-face-target small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.patch-face-target.is-active {
  border-color: rgba(13, 118, 109, 0.48);
  background: rgba(13, 118, 109, 0.13);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.1);
}

.patch-face-new-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.patch-face-new-group label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.patch-face-new-group label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.patch-face-new-group input {
  width: 100%;
  min-width: 0;
}

.patch-face-new-group .button {
  min-height: 36px;
  white-space: nowrap;
}

.patch-face-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patch-face-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  white-space: normal;
}

.fix-scratch-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.fix-scratch-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.fix-original-kv {
  grid-template-columns: 82px minmax(0, 1fr);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.fix-original-joints {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.fix-original-joint {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 7px;
  background: #fff;
}

.fix-original-joint strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.fix-original-joint span,
.fix-original-joint small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

input[type="range"] {
  height: 18px;
  accent-color: var(--green);
}

.viewer-hint {
  text-align: right;
  overflow-wrap: anywhere;
}

.detail-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.detail-drawer .detail-panel {
  align-content: start;
  margin-top: 0;
  gap: 12px;
}

.detail-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 10px 26px rgba(26, 39, 45, 0.04);
}

.detail-drawer .detail-block {
  padding: 14px;
}

.detail-block h3 {
  font-size: 18px;
}

.render-style-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.render-style-control select {
  width: auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fffefa;
  color: var(--ink);
}

.fix-summary,
.fix-status {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.fix-status:empty {
  display: none;
}

.fix-status:not(:empty) {
  margin-bottom: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(47, 99, 128, 0.22);
  border-radius: 6px;
  background: rgba(47, 99, 128, 0.06);
  color: var(--blue);
}

.fix-status.is-error:not(:empty) {
  border-color: rgba(184, 82, 53, 0.34);
  background: rgba(184, 82, 53, 0.08);
  color: var(--red);
}

.fix-record-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.fix-record-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid rgba(47, 99, 128, 0.22);
  border-radius: 999px;
  background: rgba(47, 99, 128, 0.07);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.fix-record-strip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.fix-joint-list {
  display: grid;
  gap: 10px;
}

.fix-joint-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.fix-joint-card.is-movable {
  border-left-color: var(--green);
}

.fix-joint-card.is-previewing {
  border-color: rgba(13, 118, 109, 0.42);
  box-shadow: 0 0 0 2px rgba(13, 118, 109, 0.08);
}

.fix-joint-card.is-pick-target {
  border-color: rgba(13, 118, 109, 0.54);
  box-shadow: 0 0 0 2px rgba(13, 118, 109, 0.12);
}

.joint-annotation-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.patch-variant-annotation-flags {
  margin-top: 10px;
}

.empty-inside-joint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border-color: rgba(190, 139, 36, 0.4);
  color: #74520c;
}

.empty-inside-joint-toggle::before {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.empty-inside-joint-toggle.is-active,
.empty-inside-joint-toggle[aria-pressed="true"] {
  border-color: rgba(190, 139, 36, 0.72);
  background: rgba(245, 198, 74, 0.24);
  color: #684807;
  box-shadow: inset 0 0 0 1px rgba(190, 139, 36, 0.12);
}

.empty-inside-joint-toggle.is-active::before,
.empty-inside-joint-toggle[aria-pressed="true"]::before {
  background: var(--gold);
  box-shadow: inset 0 0 0 2px #fff;
}

.fix-main-viewer.is-picking,
.fix-main-viewer.is-picking canvas {
  cursor: crosshair;
}

.fix-joint-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: start;
}

.fix-joint-head strong,
.fix-joint-head small {
  display: block;
}

.fix-joint-head strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.fix-joint-head small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.fix-joint-head select,
.fix-motion-grid select,
.fix-range-grid input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 8px;
  background: #fffefa;
  color: var(--ink);
}

.fix-card-section {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(205, 216, 218, 0.72);
  border-radius: 7px;
  background: #fffefa;
}

.fix-section-title {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fix-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fix-link-grid span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.fix-link-grid small,
.fix-motion-grid span,
.fix-range-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.fix-hidden-fields {
  display: none;
}

.fix-motion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.patch-add-type-grid {
  grid-template-columns: 1fr;
}

.patch-add-type-grid label {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
}

.patch-add-type-grid span {
  display: inline;
  white-space: nowrap;
}

.fix-range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.patch-range-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(118px, 0.42fr);
  align-items: end;
}

.fix-motion-grid select,
.fix-range-grid input {
  width: 100%;
  margin-top: 3px;
}

.patch-save-range-button {
  width: 100%;
  min-width: 118px;
  min-height: 40px;
  align-self: end;
  padding-inline: 12px;
}

.patch-add-type-grid select {
  margin-top: 0;
}

.fix-motion-grid select:disabled,
.fix-range-grid input:disabled,
.fix-preview-row input:disabled {
  opacity: 0.5;
}

.fix-origin-control {
  min-width: 0;
}

.fix-origin-control .button {
  width: 100%;
  min-height: 40px;
  margin-top: 3px;
}

.fix-origin-control small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.fix-axis-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.fix-axis-panel .fix-group-head {
  padding-bottom: 4px;
}

.fix-axis-panel [data-fix-axis-assist-status].is-error,
.fix-axis-panel [data-patch-axis-assist-status].is-error,
.patch-suggest-joint-control [data-patch-axis-assist-status].is-error {
  color: var(--red);
}

.fix-axis-action-row {
  padding: 0 8px 8px;
}

.fix-axis-action-row .button {
  width: 100%;
  min-height: 36px;
  justify-content: center;
}

.fix-axis-candidates {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}

.fix-axis-candidates:empty {
  display: none;
}

.fix-axis-candidate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  position: relative;
  min-height: 42px;
  padding: 9px 10px 9px 38px;
  border: 1px solid rgba(47, 99, 128, 0.22);
  border-left-width: 4px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  justify-items: start;
  text-align: left;
  box-shadow: 0 1px 0 rgba(26, 39, 45, 0.04);
}

.fix-axis-candidate::before {
  content: attr(data-candidate-index-label);
  position: absolute;
  left: 10px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(47, 99, 128, 0.12);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  transform: translateY(-50%);
}

.fix-axis-candidate:hover {
  border-color: rgba(47, 99, 128, 0.42);
  background: #fff;
}

.fix-axis-candidate span,
.fix-axis-candidate small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.fix-axis-candidate span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.fix-axis-candidate small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.fix-axis-candidate.is-active {
  border-color: rgba(47, 99, 128, 0.45);
  background: rgba(47, 99, 128, 0.1);
  box-shadow: inset 0 0 0 1px rgba(47, 99, 128, 0.1);
}

.fix-geometry-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.fix-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.fix-group-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.fix-group-head strong {
  color: var(--green);
  font-size: 13px;
}

.fix-group-hint {
  margin: -2px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.fix-mouse-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 8px 8px;
}

.fix-mouse-mode-row .button,
.fix-geometry-actions .button {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.fix-mouse-mode-row .button.is-active {
  border-color: rgba(13, 118, 109, 0.45);
  background: rgba(13, 118, 109, 0.12);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.12);
}

.fix-geometry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 8px 8px;
}

.fix-geometry-actions [data-fix-confirm-group] {
  border-color: rgba(13, 118, 109, 0.26);
  color: var(--green);
}

.fix-offset-panel {
  margin: 0 8px 8px;
  border: 1px solid rgba(205, 216, 218, 0.72);
  border-radius: 6px;
  background: #fffefa;
}

.fix-offset-panel .fix-group-head {
  padding-bottom: 4px;
}

.fix-offset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 8px 8px;
}

.fix-offset-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.fix-offset-grid input {
  width: 100%;
  height: 32px;
  margin-top: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 8px;
  background: #fffefa;
  color: var(--ink);
}

.fix-offset-grid input:disabled {
  opacity: 0.5;
}

.fix-keyboard-hint {
  margin: -2px 8px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.fix-mesh-list {
  display: grid;
  gap: 4px;
  max-height: 156px;
  overflow: auto;
  padding: 0 8px 8px;
}

.fix-mesh-list[hidden] {
  display: none;
}

.fix-mesh-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(205, 216, 218, 0.65);
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
}

.fix-mesh-row input {
  grid-row: span 2;
}

.fix-mesh-row span {
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.fix-mesh-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.fix-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.fix-preview-row label {
  min-width: 0;
}

.fix-preview-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.fix-preview-row input {
  width: 100%;
  margin: 0;
}

.fix-preview-row strong {
  color: var(--blue);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fix-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fix-card-actions .button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.fix-card-actions .button.is-set {
  border-color: rgba(13, 118, 109, 0.5);
  background: rgba(13, 118, 109, 0.1);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.12);
}

.patch-regroup-mode-row .button,
.fix-card-actions.patch-regroup-actions .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.15;
}

.fix-card-actions.patch-regroup-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.fix-card-actions.patch-regroup-actions .button {
  width: auto;
  min-width: 92px;
}

.fix-card-actions.patch-regroup-actions [data-patch-regroup-save] {
  min-width: 120px;
}

.patch-body {
  display: grid;
  gap: 12px;
}

.patch-actions {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) auto minmax(128px, 1fr);
  align-items: center;
  gap: 18px;
}

.patch-actions .button {
  min-width: 128px;
}

.patch-main-actions {
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.patch-reset-all {
  grid-column: 3;
  justify-self: end;
}

#patchStatus:empty + .patch-body {
  margin-top: 20px;
}

.patch-operations {
  display: grid;
  gap: 4px;
}

.patch-empty-inline {
  min-height: 0;
  padding: 12px;
}

.patch-joint-card.is-previewing {
  border-color: rgba(13, 118, 109, 0.42);
  box-shadow: 0 0 0 2px rgba(13, 118, 109, 0.08);
}

.patch-joint-card.is-suspect {
  border-left-color: var(--green);
}

.patch-current-joint-control {
  border-color: rgba(13, 118, 109, 0.2);
  background: rgba(13, 118, 109, 0.055);
}

.patch-suggest-joint-control {
  border-color: rgba(13, 118, 109, 0.24);
  background: rgba(13, 118, 109, 0.055);
}

.patch-variant-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}

.patch-variant-toolbar label,
.patch-variant-count {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.patch-variant-toolbar label > span,
.patch-variant-count > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.patch-variant-count {
  min-width: 82px;
  text-align: center;
}

.patch-variant-count strong {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}

.patch-variant-workspace {
  border-color: rgba(47, 99, 128, 0.34);
  background: rgba(47, 99, 128, 0.055);
}

.patch-variant-workspace .patch-enable-control span {
  display: grid;
  gap: 2px;
}

.patch-variant-workspace .patch-enable-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.patch-variant-workspace[hidden] {
  display: none;
}

.patch-toilet-animation-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.patch-toilet-animation-choice {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.patch-toilet-animation-choice strong {
  font-size: 13px;
}

.patch-toilet-animation-choice small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.patch-toilet-animation-choice.is-active {
  border-color: rgba(13, 118, 109, 0.58);
  background: rgba(13, 118, 109, 0.1);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.16);
}

.patch-toilet-animation-choice.is-active strong {
  color: var(--green);
}

.patch-toilet-animation-choice:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.patch-animation-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.patch-variant-motion-control {
  border-color: rgba(13, 118, 109, 0.22);
  background: rgba(13, 118, 109, 0.05);
}

.patch-variant-combinations {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.patch-combination-list {
  display: grid;
}

.patch-combination-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.patch-combination-row > span {
  display: grid;
  min-width: 0;
}

.patch-combination-row strong,
.patch-combination-row small {
  overflow-wrap: anywhere;
}

.patch-combination-row small {
  color: var(--muted);
}

.patch-combination-row.is-active strong {
  color: var(--green);
}

.patch-combination-row > .patch-combination-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.patch-saved-variants {
  display: grid;
  gap: 6px;
}

.patch-saved-variant {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(13, 118, 109, 0.2);
  background: rgba(13, 118, 109, 0.05);
}

.patch-saved-variant strong,
.patch-saved-variant span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.patch-saved-variant span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.patch-saved-variant .button {
  justify-self: end;
}

.patch-human-label-section {
  border-color: rgba(13, 118, 109, 0.2);
  background: rgba(13, 118, 109, 0.055);
  gap: 12px;
}

.fix-axis-candidate-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fix-axis-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.fix-axis-flip-button,
.fix-axis-review-button,
.fix-axis-save-button {
  min-width: 118px;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.fix-axis-flip-button,
.fix-axis-review-button {
  min-width: 72px;
}

.patch-axis-candidates {
  padding: 0;
}

.patch-suggest-joint-control .fix-axis-candidate {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: rgba(13, 118, 109, 0.24);
  border-left-color: rgba(13, 118, 109, 0.72);
  background: rgba(255, 255, 255, 0.76);
}

.patch-suggest-joint-control .fix-axis-candidate::before {
  background: rgba(13, 118, 109, 0.14);
  color: var(--green);
}

.patch-suggest-joint-control .fix-axis-candidate:hover {
  border-color: rgba(13, 118, 109, 0.42);
  background: #fff;
}

.patch-suggest-joint-control .fix-axis-candidate.is-active {
  border-color: rgba(13, 118, 109, 0.48);
  background: rgba(13, 118, 109, 0.1);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.12);
}

.patch-suggest-joint-control .fix-axis-candidate.is-variant-ready {
  border-color: rgba(47, 99, 128, 0.42);
  border-left-color: rgba(47, 99, 128, 0.78);
  background: rgba(47, 99, 128, 0.08);
}

.patch-suggest-joint-control .fix-axis-candidate.is-variant-ready::before {
  background: rgba(47, 99, 128, 0.16);
  color: var(--blue);
}

.patch-suggest-joint-control .fix-axis-candidate.is-saved {
  border-color: rgba(13, 118, 109, 0.28);
  border-left-color: rgba(13, 118, 109, 0.76);
  background: rgba(13, 118, 109, 0.1);
  opacity: 0.72;
}

.patch-suggest-joint-control .fix-axis-candidate.is-saved .fix-axis-save-button,
.patch-suggest-joint-control .fix-axis-candidate.is-saved .fix-axis-flip-button,
.patch-suggest-joint-control .fix-axis-candidate.is-saved .fix-axis-review-button {
  cursor: not-allowed;
}

.patch-variant-workspace .fix-axis-candidate {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: rgba(47, 99, 128, 0.42);
  border-left-color: rgba(47, 99, 128, 0.78);
  background: rgba(255, 255, 255, 0.82);
}

.patch-variant-workspace .fix-axis-candidate::before {
  background: rgba(47, 99, 128, 0.16);
  color: var(--blue);
}

.patch-variant-workspace .fix-axis-candidate.is-active {
  border-color: rgba(47, 99, 128, 0.68);
  background: rgba(47, 99, 128, 0.13);
  box-shadow: inset 0 0 0 1px rgba(47, 99, 128, 0.16);
}

.patch-variant-workspace .fix-axis-candidate.is-saved {
  border-color: rgba(13, 118, 109, 0.28);
  border-left-color: rgba(13, 118, 109, 0.76);
  background: rgba(13, 118, 109, 0.1);
  opacity: 0.72;
}

.patch-enable-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.patch-enable-control span {
  min-width: 0;
}

.patch-axis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.patch-origin-grid {
  align-items: end;
}

.patch-human-axis-grid {
  padding-top: 2px;
}

.patch-origin-control {
  min-width: 0;
}

.patch-origin-control span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-origin-control .button {
  width: 100%;
  min-height: 40px;
  margin-top: 3px;
  padding: 7px 8px;
  font-size: 12px;
}

.patch-axis-grid span,
.patch-range-grid span,
.patch-range-editor-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.patch-axis-grid input,
.patch-axis-grid select {
  width: 100%;
  height: 40px;
  margin-top: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 8px;
  background: #fffefa;
  color: var(--ink);
}

.patch-axis-grid input:disabled,
.patch-axis-grid select:disabled {
  opacity: 0.5;
}

.patch-range-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.patch-range-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.patch-range-editor-head strong {
  color: var(--green);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  white-space: nowrap;
}

.patch-range-rail {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(143, 154, 157, 0.28), rgba(143, 154, 157, 0.18));
  box-shadow: inset 0 0 0 1px rgba(98, 113, 117, 0.18);
}

.patch-range-original,
.patch-range-active {
  position: absolute;
  top: 9px;
  bottom: 9px;
  border-radius: 999px;
  pointer-events: none;
}

.patch-range-original {
  left: var(--range-original-left);
  right: calc(100% - var(--range-original-right));
  background: rgba(13, 118, 109, 0.72);
}

.patch-range-active {
  left: var(--range-active-left);
  right: calc(100% - var(--range-active-right));
  background: rgba(13, 118, 109, 0.2);
  box-shadow: inset 0 0 0 1px rgba(13, 118, 109, 0.34);
}

.patch-range-handle {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 24px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: #fff;
  cursor: ew-resize;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 5px rgba(26, 39, 45, 0.14);
}

.patch-range-handle.is-lower {
  left: var(--range-lower-left);
}

.patch-range-handle.is-upper {
  left: var(--range-upper-left);
}

.patch-range-handle:focus-visible {
  outline: 2px solid rgba(13, 118, 109, 0.3);
  outline-offset: 2px;
}

.patch-range-handle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

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

.patch-add-human-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  color: var(--muted);
}

.kv dt {
  font-weight: 800;
  color: var(--ink);
}

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.joint-list,
.tree-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.joint-type-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.joint-type-chip {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-inside-joint-metadata {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 7px 12px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.empty-inside-joint-metadata[hidden] {
  display: none;
}

.empty-inside-joint-metadata dt {
  color: var(--muted);
  font-weight: 800;
}

.empty-inside-joint-metadata dd {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.joint-item {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.joint-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.joint-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.joint-name small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.joint-value {
  color: var(--green);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  white-space: nowrap;
}

.joint-item input[type="range"] {
  width: 100%;
  margin: 0;
}

.tree-node {
  border-left: 3px solid var(--green);
  padding-left: 10px;
  color: var(--muted);
}

.tree-node strong {
  color: var(--ink);
}

.api-grid a {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffefa;
  color: var(--blue);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.api-grid a:hover {
  border-color: var(--blue);
  background: #fff;
}

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

.empty-state,
.error-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--muted);
}

.error-state {
  border-color: rgba(159, 63, 52, 0.38);
  color: var(--red);
}

@media (min-width: 1500px) {
  body.is-detail-open {
    --detail-pane-width: clamp(800px, 46vw, 960px);
  }

  body.is-detail-open .browser-head,
  body.is-detail-open .workbench {
    width: calc(100vw - var(--detail-pane-width) - 72px);
    margin-left: 24px;
    margin-right: 0;
  }

  body.is-detail-open .workbench {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
  }

  body.is-detail-open .results {
    min-width: 0;
  }

  body.is-detail-open .detail-drawer {
    width: var(--detail-pane-width);
  }
}

@media (max-width: 1180px) {
  .stats-grid,
  .api-grid,
  .detail-layout,
  .workbench {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .browser-head {
    align-items: start;
    flex-direction: column;
  }

  .stats-grid,
  .category-panel,
  .browser-head,
  .workbench {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
  }

  .citation-content {
    width: calc(100% - 40px);
    margin-inline: auto;
  }

  .detail-drawer {
    top: 72px;
    right: 12px;
    bottom: 12px;
    display: block;
    width: calc(100vw - 24px);
    overflow: auto;
  }

  .detail-drawer .detail-layout {
    display: block;
    height: auto;
  }

  .detail-drawer .viewer-panel,
  .detail-drawer .detail-panel {
    padding-right: 0;
    overflow: visible;
  }

  .detail-drawer .detail-panel {
    margin-top: 18px;
  }

  .detail-drawer .viewer,
  .detail-drawer .viewer canvas {
    height: clamp(440px, 58vh, 600px);
    min-height: 440px;
  }

  .fix-page-body {
    overflow: auto;
  }

  .fix-page {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .fix-main-viewer,
  .fix-main-viewer canvas {
    min-height: 480px;
  }
}

@media (max-width: 700px) {
  .dataset-cover {
    min-height: 230px;
  }

  .dataset-cover-image {
    object-position: 74% center;
  }

  .dataset-cover-content {
    width: calc(100% - 40px);
    min-height: 230px;
    margin-left: 20px;
    padding: 20px 0;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .hero {
    min-height: 32vh;
  }

  .hero-copy {
    font-size: 16px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .stats-grid,
  .category-panel,
  .browser-head,
  .workbench {
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
  }

  .citation-content {
    width: calc(100% - 20px);
    margin-inline: auto;
  }

  .category-panel-head {
    align-items: start;
    flex-direction: column;
  }

  .category-rail {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  }

  .object-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .detail-drawer {
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    padding: 12px;
  }

  .detail-drawer .viewer,
  .detail-drawer .viewer canvas,
  .detail-drawer .fixed-result-viewer,
  .detail-drawer .fixed-result-viewer canvas {
    height: 360px;
    min-height: 360px;
  }

  .drawer-top h2 {
    font-size: 22px;
  }

  .viewer,
  .viewer canvas {
    min-height: 360px;
  }

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

  .fix-load-form {
    width: 100%;
    min-width: 0;
  }

  .fix-viewer-head,
  .fix-operation-head {
    align-items: start;
    flex-direction: column;
  }

  .patch-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .patch-main-actions {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .patch-main-actions .patch-return-browser {
    grid-column: 1 / -1;
  }

  .patch-reset-all {
    grid-column: 1;
    justify-self: stretch;
  }

  .patch-actions .button {
    width: 100%;
    min-width: 0;
  }

  .patch-face-targets {
    grid-template-columns: minmax(0, 1fr);
  }

  .patch-face-new-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .patch-cluster-mode-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .patch-regroup-mode-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .patch-regroup-target-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .patch-regroup-current-target {
    grid-template-columns: 12px auto minmax(0, 1fr);
  }

  .patch-regroup-current-target small {
    grid-column: 2 / -1;
  }

  .patch-regroup-pending-summary {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .patch-regroup-pending-summary > span:last-child {
    grid-column: 2 / -1;
    text-align: left;
  }

  .fix-card-actions.patch-regroup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .fix-card-actions.patch-regroup-actions .button,
  .fix-card-actions.patch-regroup-actions [data-patch-regroup-save] {
    width: 100%;
    min-width: 0;
  }

  .patch-placement-grid,
  .patch-placement-point-status,
  .patch-placement-point-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .patch-placement-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .patch-placement-actions .button,
  .patch-placement-actions [data-patch-placement-save] {
    width: 100%;
    min-width: 0;
  }

  .fix-link-grid,
  .fix-motion-grid,
  .fix-range-grid,
  .fix-preview-row,
  .patch-axis-grid,
  .patch-regroup-controls,
  .fix-geometry-actions,
  .fix-offset-grid,
  .fix-mouse-mode-row,
  .fix-card-actions,
  .patch-suggest-joint-control .fix-axis-candidate,
  .patch-variant-workspace .fix-axis-candidate,
  .patch-variant-toolbar,
  .patch-toilet-animation-choices,
  .patch-saved-variant,
  .patch-combination-row {
    grid-template-columns: 1fr;
  }

  .patch-combination-row > .patch-combination-actions {
    justify-content: flex-start;
  }

  .patch-saved-variant span {
    text-align: left;
  }

  .patch-saved-variant .button {
    justify-self: start;
  }
}
