:root {
  --bg: #f2f0e9;
  --panel: #fffdf8;
  --ink: #17201d;
  --muted: #68716d;
  --line: #d8d8cf;
  --green: #28695c;
  --green-dark: #17483f;
  --blue: #3b6f89;
  --rust: #a35e43;
  --gold: #c99b35;
  --sire: #d4e6e0;
  --dam: #eedbd3;
  --focus: #005fce;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  min-height: 62px;
  padding: 10px max(16px, calc((100vw - 1480px) / 2 + 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 253, 248, .96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.site-brand strong,
.site-brand small { display: block; }

.site-brand strong { font-size: 15px; }

.site-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-nav a {
  min-height: 32px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.page-nav a:hover,
.page-nav a:focus-visible {
  background: #e4efeb;
  outline: 2px solid rgba(40, 105, 92, .16);
  outline-offset: 1px;
}

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 24px 34px;
}

.title-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 2px 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.08;
}

.lead {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.title-data {
  min-width: min(100%, 510px);
  display: grid;
  gap: 9px;
}

.horse-switcher {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.horse-switcher span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.horse-switcher select {
  min-width: 230px;
  height: 36px;
  padding: 0 34px 0 11px;
  border: 1px solid #bfc8c3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.horse-switcher select:focus-visible {
  border-color: var(--green);
  outline: 2px solid rgba(40, 105, 92, .2);
  outline-offset: 1px;
}

.subject-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, auto));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.subject-facts div {
  padding: 8px 14px;
  border-left: 1px solid var(--line);
}

.subject-facts div:first-child { border-left: 0; }

.subject-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.subject-facts dd {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.chart-workspace { min-width: 0; }

.toolbar {
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #faf9f4;
}

.search-field {
  height: 38px;
  min-width: 210px;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #c9cec9;
  border-radius: 6px;
  background: #fff;
}

.search-field > span[aria-hidden] {
  color: var(--green);
  font-size: 22px;
  line-height: 1;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

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

.generation-control,
.icon-controls,
.segmented {
  display: flex;
  align-items: center;
}

.generation-control { gap: 7px; }

.generation-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.segmented {
  border: 1px solid #c9cec9;
  border-radius: 6px;
  overflow: hidden;
}

.segmented button,
.icon-controls button {
  height: 34px;
  border: 0;
  background: #fff;
  color: #4b5651;
  cursor: pointer;
  font-weight: 800;
}

.segmented button {
  min-width: 42px;
  padding: 0 7px;
  border-left: 1px solid #d6d9d6;
  font-size: 11px;
}

.segmented button:first-child { border-left: 0; }

.segmented button:hover,
.segmented button:focus-visible,
.segmented button.is-active {
  background: var(--green);
  color: #fff;
}

.icon-controls {
  gap: 4px;
  flex: 0 0 auto;
}

.icon-controls button {
  width: 34px;
  padding: 0;
  border: 1px solid #c9cec9;
  border-radius: 6px;
  font-size: 18px;
}

.icon-controls button:hover,
.icon-controls button:focus-visible {
  border-color: var(--green);
  color: var(--green-dark);
  outline: 2px solid rgba(40, 105, 92, .16);
  outline-offset: 1px;
}

.chart-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(78vh, 1050px);
  min-height: 520px;
  overflow: hidden;
  background: #fff;
  cursor: grab;
  touch-action: none;
}

.chart-stage.is-dragging { cursor: grabbing; }

#pedigree-chart {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.pedigree-sector {
  stroke: rgba(255, 255, 255, .96);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: filter .12s ease, opacity .12s ease, stroke .12s ease;
}

.pedigree-sector.side-sire { fill: var(--sector-fill, var(--sire)); }
.pedigree-sector.side-dam { fill: var(--sector-fill, var(--dam)); }

.chart-stage.show-duplicates .pedigree-sector.is-duplicate:not(.is-match):not(.is-selected):not(.is-related) {
  stroke: var(--gold);
  stroke-width: 1.45;
}

.pedigree-sector:hover,
.pedigree-sector.is-selected {
  filter: brightness(.94) saturate(1.24);
  stroke: var(--focus);
  stroke-width: 2.5;
}

.pedigree-sector.is-related {
  stroke: var(--gold);
  stroke-width: 2.3;
}

.pedigree-sector.is-match {
  fill: #ffe173;
  stroke: #6b5200;
  stroke-width: 2.6;
}

.pedigree-sector.is-lineage {
  fill: #cfe9df;
  stroke: #0b776a;
  stroke-width: 2.2;
  opacity: 1;
}

.pedigree-sector.is-pinned {
  fill: var(--pin-color);
  stroke: #263c35;
  stroke-width: 2.4;
  opacity: 1;
}

.pedigree-sector.is-pinned.is-selected {
  stroke: var(--focus);
  stroke-width: 3.2;
}

.pedigree-sector.is-pinned.is-lineage {
  fill: var(--pin-color);
  stroke: #0b776a;
  stroke-width: 3px;
}

.pedigree-sector.is-pinned.is-muted { opacity: .38; }

.pedigree-sector.is-muted { opacity: .16; }

.pedigree-sector.is-hidden,
.pedigree-label.is-hidden { display: none; }

.pedigree-label {
  fill: #21302b;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 1.1px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.pedigree-label.is-outer { font-weight: 900; }

.pedigree-label.is-emphasized {
  fill: #102b22;
  stroke: #fff;
  stroke-width: 2px;
}

.pedigree-label.is-pinned-label { font-weight: 900; }

.pedigree-label.is-lineage-label {
  fill: #075f55;
  font-weight: 900;
}

.pedigree-label.label-light { fill: #fff; }

.center-disc {
  fill: #fffdf8;
  stroke: var(--green-dark);
  stroke-width: 5;
  cursor: pointer;
}

.center-ring {
  fill: none;
  stroke: #c99b35;
  stroke-width: 2;
}

.center-name {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 900;
  text-anchor: middle;
}

.center-meta {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  max-width: 230px;
  padding: 8px 10px;
  border: 1px solid #223832;
  border-radius: 6px;
  background: rgba(23, 32, 29, .95);
  color: #fff;
  box-shadow: 0 6px 18px rgba(23, 32, 29, .2);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}

.chart-tooltip strong { display: block; }
.chart-tooltip span { color: #dbe7e2; }

.chart-key {
  min-height: 44px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-key span,
.chart-key button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-key #lineage-key[hidden] { display: none; }
.chart-key #lineage-key b { color: var(--green-dark); font-size: 10px; }

.chart-key button {
  padding: 3px 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.chart-key button[aria-pressed="false"] { opacity: .45; }
.chart-key button:disabled { opacity: .32; cursor: not-allowed; }

#pin-selected,
#clear-pins {
  min-height: 27px;
  padding: 3px 7px;
  border: 1px solid #cbd0cb;
  border-radius: 4px;
  background: #fff;
}

#pin-selected[aria-pressed="true"] {
  border-color: var(--gold);
  background: #fff9e9;
}

#pin-selected:not(:disabled):hover,
#pin-selected:not(:disabled):focus-visible,
#clear-pins:not(:disabled):hover,
#clear-pins:not(:disabled):focus-visible {
  border-color: var(--green);
  color: var(--green-dark);
  outline: 2px solid rgba(40, 105, 92, .14);
  outline-offset: 1px;
}

.chart-key i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, .12);
}

.key-sire { background: var(--sire); }
.key-dam { background: var(--dam); }
.key-duplicate { background: #fff; box-shadow: inset 0 0 0 2px var(--gold); }
.key-lineage { background: #cfe9df; box-shadow: inset 0 0 0 2px #0b776a; }
.key-pinned { background: #d6d9d6; }
.chart-total { margin-left: auto; }

.pin-legend {
  min-height: 42px;
  padding: 7px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--line);
  background: #f7f8f5;
}

.pin-legend[hidden] { display: none; }

.pin-legend-item {
  min-width: 0;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #ccd1cc;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.pin-legend-item button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.pin-legend-select {
  min-width: 0;
  padding: 5px 7px;
  display: inline-grid;
  grid-template-columns: 11px auto;
  gap: 0 6px;
  align-items: center;
  text-align: left;
}

.pin-legend-select i {
  width: 10px;
  height: 10px;
  grid-row: 1 / 3;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 2px;
  background: var(--pin-color);
}

.pin-legend-select strong { font-size: 11px; line-height: 1.2; }
.pin-legend-select small { color: var(--muted); font-size: 9px; font-weight: 800; }

.pin-legend-remove {
  width: 28px;
  border-left: 1px solid #d8dbd7 !important;
  font-size: 15px;
  font-weight: 900;
}

.pin-legend-item button:hover,
.pin-legend-item button:focus-visible { background: #edf2ef; outline: 0; }

.inspector {
  min-height: 100%;
  border-left: 1px solid var(--line);
  background: #f8f7f2;
}

.inspector-head { padding: 22px 20px 17px; }

.inspector h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

#inspector-en {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.detail-list {
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-list div {
  min-height: 41px;
  padding: 9px 20px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  border-top: 1px solid #e2e2da;
}

.detail-list div:first-child { border-top: 0; }

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.duplicate-section { padding: 19px 20px 14px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 14px;
}

.section-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.duplicate-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.duplicate-list li { border-bottom: 1px solid var(--line); }

.duplicate-list button {
  width: 100%;
  min-height: 38px;
  padding: 7px 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
}

.duplicate-list button:hover,
.duplicate-list button:focus-visible { color: var(--green); }

.duplicate-rank {
  color: var(--gold);
  font-weight: 900;
}

.duplicate-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.duplicate-cross {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-blood {
  display: grid;
  justify-items: end;
  gap: 1px;
  color: var(--green-dark);
}

.duplicate-blood strong { font-size: 10px; }

.duplicate-blood small {
  color: var(--muted);
  font-size: 9px;
}

.show-all-duplicates {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--green);
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}

.show-all-duplicates:hover,
.show-all-duplicates:focus-visible { color: var(--rust); }

.show-all-duplicates span { white-space: nowrap; }

.duplicate-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 820px);
  padding: 0;
  border: 1px solid #aeb8b3;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  overflow: hidden;
}

.duplicate-dialog::backdrop { background: rgba(20, 31, 27, .68); }

.dialog-head {
  min-height: 76px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8f7f2;
}

.dialog-head h2 {
  margin: 0;
  font-size: 22px;
}

.dialog-head h2 span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #c7ccc8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.dialog-close:hover,
.dialog-close:focus-visible { border-color: var(--green); color: var(--green); }

.dialog-tools {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-search {
  min-height: 38px;
  min-width: 220px;
  flex: 1;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c7ccc8;
  border-radius: 6px;
  background: #fff;
}

.dialog-search > span { color: var(--green); font-size: 22px; }

.dialog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.dialog-sort {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dialog-sort select {
  min-height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid #c7ccc8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.duplicate-table-wrap {
  max-height: calc(min(88vh, 820px) - 220px);
  overflow: auto;
}

.duplicate-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.duplicate-table th {
  padding: 9px 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #bfc5c1;
  background: #eef1ee;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.duplicate-table th:first-child { width: 30%; }
.duplicate-table th:nth-child(2) { width: 42%; }
.duplicate-table th:nth-child(3) { width: 17%; text-align: right; }
.duplicate-table th:nth-child(4) { width: 11%; text-align: right; }

.duplicate-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e0e1dc;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.duplicate-table td:nth-child(2) { color: var(--muted); font-weight: 800; }
.duplicate-table td:nth-child(3),
.duplicate-table td:nth-child(4) { text-align: right; white-space: nowrap; }

.duplicate-table tr:hover td { background: #f3f7f5; }

.duplicate-name-button {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-name-button:hover,
.duplicate-name-button:focus-visible { color: var(--rust); text-decoration: underline; }

.duplicate-empty {
  margin: 0;
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.blood-note {
  margin: 0;
  padding: 9px 18px;
  border-top: 1px solid var(--line);
  background: #f8f7f2;
  color: var(--muted);
  font-size: 10px;
}

.source-link {
  margin: 2px 20px 20px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.source-link:hover,
.source-link:focus-visible {
  background: #e4efeb;
  outline: 2px solid rgba(40, 105, 92, .16);
  outline-offset: 1px;
}

.source-footer {
  padding: 16px 2px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

.source-footer p { margin: 0; }

@media (max-width: 1050px) {
  .toolbar { flex-wrap: wrap; }
  .search-field { order: 1; flex-basis: 100%; }
  .generation-control { order: 2; }
  .icon-controls { order: 3; margin-left: auto; }
}

@media (max-width: 840px) {
  .page { padding: 16px 12px 28px; }
  .title-band { display: block; }
  .title-data { min-width: 0; margin-top: 16px; }
  .horse-switcher { justify-content: flex-start; }
  .subject-facts { grid-template-columns: repeat(2, 1fr); }
  .subject-facts div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .subject-facts div:nth-child(4) { border-top: 1px solid var(--line); }
  .tool-layout { display: block; }
  .inspector { border-top: 1px solid var(--line); border-left: 0; }
  .chart-stage { min-height: 0; max-height: none; }
  .source-footer { display: block; }
  .source-footer p + p { margin-top: 5px; }
}

@media (max-width: 560px) {
  .site-header { min-height: 54px; padding: 8px 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .site-brand strong { font-size: 13px; }
  .page-nav a { font-size: 11px; padding-inline: 7px; }
  .page-nav a:last-child { display: none; }
  .page { padding: 12px 8px 24px; }
  h1 { font-size: 31px; }
  .lead { font-size: 13px; }
  .horse-switcher { align-items: stretch; flex-direction: column; gap: 5px; }
  .horse-switcher select { width: 100%; min-width: 0; }
  .subject-facts div { padding: 8px 10px; }
  .toolbar { gap: 8px; padding: 8px; }
  .generation-control { width: 100%; justify-content: space-between; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; }
  .icon-controls { width: 100%; margin-left: 0; justify-content: space-between; }
  .icon-controls button { width: 18%; }
  .chart-key { gap: 10px; padding: 8px 10px; flex-wrap: wrap; }
  .chart-total { width: 100%; margin-left: 0; }
  .inspector-head { padding: 18px 16px 15px; }
  .detail-list div { padding: 9px 16px; }
  .duplicate-section { padding: 17px 16px 12px; }
  .source-link { margin: 2px 16px 18px; }
  .duplicate-dialog { width: calc(100vw - 16px); max-height: 92vh; }
  .dialog-head { padding: 13px 12px; }
  .dialog-head h2 { font-size: 18px; }
  .dialog-tools { padding: 9px 12px; display: grid; }
  .dialog-search { min-width: 0; }
  .dialog-sort { justify-content: space-between; }
  .dialog-sort select { flex: 1; }
  .duplicate-table-wrap { max-height: calc(92vh - 250px); }
  .duplicate-table { min-width: 640px; }
  .blood-note { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
