/* =========================================================
   種雄牛情報（Figma「種雄牛情報 一覧」「詳細モーダル」）
   ========================================================= */
.gh-sd,
.gh-sd-modal {
  --sd-blue: var(--gh-blue);
  --sd-pale: var(--gh-pale);
  --sd-line: var(--gh-line);
  --sd-field: var(--gh-field);
  --sd-neg: var(--gh-red);
  font-size: 14px;
  color: var(--gh-ink);
}

.gh-sd__loading,
.gh-sd-empty-all {
  padding: 40px 0;
  text-align: center;
  color: var(--gh-sub);
}

.gh-sd button,
.gh-sd-modal button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ---------- タブ ---------- */
.gh-sd-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.gh-sd-tab {
  padding: 16px 8px;
  font-size: 18px !important;
  font-weight: 700;
  color: var(--sd-blue) !important;
  background: var(--sd-pale);
  border: 0;
  border-radius: 12px 12px 0 0;
}

.gh-sd-tab.is-active {
  color: #fff !important;
  background: var(--sd-blue);
}

.gh-sd-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 16px;
  background: var(--sd-pale);
}

.gh-sd-sub {
  padding: 8px 22px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gh-sub) !important;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
}

.gh-sd-sub:hover {
  color: var(--sd-blue) !important;
}

.gh-sd-sub.is-active {
  color: var(--sd-blue) !important;
  background: #fff;
  border-color: var(--sd-blue);
}

/* ---------- 見出し ---------- */
.gh-sd-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 24px;
}

.gh-sd .gh-sd-title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gh-ink) !important;
  background: none !important;
  border: 0 !important;
}

.gh-sd .gh-sd-title::before,
.gh-sd .gh-sd-title::after {
  content: none !important;
}

.gh-sd-meta {
  margin: 4px 0 0 !important;
  font-size: 14px;
  color: var(--gh-sub);
}

.gh-sd-meta > span:not(.gh-sd-count) {
  margin: 0 12px;
  color: var(--sd-line);
}

.gh-sd-pdf,
.gh-sd-mpdf {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 700;
  color: var(--sd-blue) !important;
  background: #fff;
  border: 1px solid var(--sd-blue);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.gh-sd-pdf:hover,
.gh-sd-mpdf:hover {
  color: #fff !important;
  background: var(--sd-blue);
}

/* ---------- 絞り込み ---------- */
.gh-sd-filter {
  margin-bottom: 28px;
  background: var(--sd-field);
  border: 1px solid var(--sd-line);
  border-radius: 16px;
}

.gh-sd-filter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 28px;
  font-size: 16px !important;
  font-weight: 700;
  text-align: left;
  background: none;
  border: 0;
}

.gh-sd-filter__head span {
  font-size: 13px;
  color: var(--sd-blue);
}

.gh-sd-filter__head span::after {
  content: " ▼";
}

.gh-sd-filter.is-open .gh-sd-filter__head span::after {
  content: " ▲";
}

.gh-sd-filter__body {
  display: none;
  padding: 0 28px 24px;
}

.gh-sd-filter.is-open .gh-sd-filter__body {
  display: block;
}

.gh-sd-frow {
  display: grid;
  grid-template-columns: 136px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.gh-sd-flabel {
  font-size: 13px;
  font-weight: 700;
  color: var(--gh-sub);
}

.gh-sd-kw,
.gh-sd-range select,
.gh-sd-range input {
  height: 40px;
  padding: 0 14px;
  font: inherit;
  background: #fff;
  border: 1px solid var(--sd-line);
  border-radius: 6px;
}

.gh-sd-kw {
  width: 100%;
}

.gh-sd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gh-sd-chip {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--sd-line);
  border-radius: 999px;
}

.gh-sd-chip.is-on {
  color: #fff !important;
  background: var(--sd-blue);
  border-color: var(--sd-blue);
}

.gh-sd-ranges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.gh-sd-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.gh-sd-range select {
  width: 200px;
}

.gh-sd-range input {
  width: 120px;
}

.gh-sd-range__del,
.gh-sd-addrange {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sd-blue) !important;
  background: none;
  border: 0;
}

.gh-sd-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.gh-sd-switch input {
  position: absolute;
  opacity: 0;
}

.gh-sd-switch span {
  position: relative;
  width: 40px;
  height: 22px;
  background: #c4cdd5;
  border-radius: 999px;
  transition: background 0.2s;
}

.gh-sd-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.gh-sd-switch input:checked + span {
  background: var(--sd-blue);
}

.gh-sd-switch input:checked + span::after {
  transform: translateX(18px);
}

.gh-sd-switch input:focus-visible + span {
  outline: 2px solid var(--sd-blue);
  outline-offset: 2px;
}

.gh-sd-factions {
  text-align: right;
}

.gh-sd-clear {
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gh-sub) !important;
  background: none;
  border: 0;
  text-decoration: underline;
}

/* ---------- 表 ---------- */
.gh-sd-hint,
.gh-sd-note {
  margin: 0 0 10px !important;
  font-size: 12px;
  color: var(--gh-sub);
}

.gh-sd-scroll {
  max-height: min(70vh, 760px);
  overflow: auto;
  border: 1px solid var(--sd-line);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.gh-sd-table {
  width: max-content;
  min-width: 100%;
  margin: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.gh-sd-table th,
.gh-sd-table td {
  padding: 12px 10px;
  white-space: nowrap;
  vertical-align: middle;
  background: #fff;
  border: 0 !important;
  border-bottom: 1px solid var(--sd-line) !important;
}

.gh-sd-table tbody tr:nth-child(even) td {
  background: #f9fbfc;
}

.gh-sd-table tbody tr.is-checked td {
  background: #fff8e1;
}

.gh-sd-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  text-align: left;
  background: var(--sd-blue);
}

.gh-sd-table thead th small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
}

.gh-sd-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gh-sd-table .is-strong {
  font-weight: 700;
}


.gh-sd-sort {
  padding: 0;
  font-weight: 700;
  line-height: inherit;
  color: #fff !important;
  text-align: right;
  background: none;
  border: 0;
}

.gh-sd-sort:hover {
  text-decoration: underline;
}

/* 左の列を固定 */
.gh-sd-c-check {
  position: sticky;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-inline: 0 !important;
  text-align: center;
}

.gh-sd-table .is-sticky {
  position: sticky;
  left: 44px;
  z-index: 1;
}

.gh-sd-table .is-sticky2 {
  left: var(--sd-c1, 130px);
  box-shadow: 6px 0 6px -4px rgb(0 0 0 / 12%);
}

.gh-sd-table thead .gh-sd-c-check,
.gh-sd-table thead .is-sticky {
  z-index: 3;
}

.gh-sd-check {
  width: 18px;
  height: 18px;
  accent-color: var(--sd-blue);
  cursor: pointer;
}

.gh-sd-open {
  padding: 0;
  font-weight: 700;
  color: var(--sd-blue) !important;
  text-align: left;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gh-sd-grade {
  display: inline-block;
  min-width: 1.6em;
  margin-left: 4px;
  font-weight: 700;
  color: var(--sd-blue);
  text-align: center;
}

.gh-sd-na {
  color: #aab4bd;
}

.gh-sd-empty {
  padding: 40px 16px !important;
  text-align: center !important;
  white-space: normal !important;
  color: var(--gh-sub);
}

/* ---------- アイコン ---------- */
.gh-sd-badge {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  color: #fff;
  vertical-align: middle;
  white-space: nowrap;
  background: #607080;
  border-radius: 3px;
}

.gh-sd-badge.is-a2 { background: #2e7d32; }
.gh-sd-badge.is-polled { background: #00838f; }
.gh-sd-badge.is-red { background: #c62828; }
.gh-sd-badge.is-robot { background: #37474f; }
.gh-sd-badge.is-long { background: #7e57c2; }
.gh-sd-badge.is-graze { background: #7cb342; }
.gh-sd-badge.is-ghx { background: #ef6c00; }

.gh-sd-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--gh-sub);
}

.gh-sd-legend dt {
  font-weight: 700;
}

.gh-sd-legend dd {
  margin: 0;
}

/* ---------- 詳細（モーダル） ---------- */
.gh-sd-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(946px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 64px);
  padding: 0;
  overflow: auto;
  color: var(--gh-ink);
  background: #fff;
  border: 0;
  border-radius: 24px;
  overscroll-behavior: contain;
}

.gh-sd-modal::backdrop {
  background: rgb(20 26 38 / 88%);
}

html:has(.gh-sd-modal[open]) {
  overflow: hidden;
}

.gh-sd-mbody {
  padding: 40px 40px 48px;
  font-size: 14px;
}

.gh-sd-mtools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.gh-sd-mclose {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  background: #f0f3f6;
  border: 0;
  border-radius: 50%;
}

.gh-sd-mtop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.gh-sd-photo.is-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  color: var(--gh-sub);
  background: var(--sd-field);
  border-radius: 12px;
}

.gh-sd-slides {
  position: relative;
}

.gh-sd-slide {
  position: relative;
  margin: 0;
}

.gh-sd-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #eef2f5;
  border-radius: 12px;
}

.gh-sd-slide figcaption {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border-radius: 999px;
}

.gh-sd-slide-prev,
.gh-sd-slide-next {
  position: absolute;
  top: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  background: rgb(255 255 255 / 90%);
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}

.gh-sd-slide-prev { left: 10px; }
.gh-sd-slide-next { right: 10px; }

.gh-sd-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gh-sd-thumb {
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gh-sub) !important;
  background: #f0f3f6;
  border: 0;
  border-radius: 999px;
}

.gh-sd-thumb.is-active {
  color: #fff !important;
  background: var(--sd-blue);
}

.gh-sd-mlabel {
  margin: 0 0 6px !important;
  font-size: 13px;
  color: var(--gh-sub);
}

.gh-sd-mlabel span {
  margin: 0 12px;
  color: var(--sd-line);
}

.gh-sd-modal h2 {
  margin: 0 0 10px !important;
  padding: 0 !important;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--gh-ink) !important;
  background: none !important;
  border: 0 !important;
}

.gh-sd-modal h2::before,
.gh-sd-modal h2::after,
.gh-sd-modal h3::before,
.gh-sd-modal h3::after {
  content: none !important;
}

.gh-sd-mbadges {
  margin-bottom: 12px;
}

.gh-sd-info {
  width: 100%;
  margin: 0 !important;
  border-collapse: collapse;
}

.gh-sd-info th,
.gh-sd-info td {
  padding: 10px 0 !important;
  text-align: left;
  vertical-align: top;
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--sd-line) !important;
}

.gh-sd-info th {
  width: 8.5em;
  font-size: 13px;
  font-weight: 700;
  color: var(--gh-sub);
}

.gh-sd-msec {
  margin-top: 48px;
}

.gh-sd-modal h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px !important;
  padding: 0 0 0 12px !important;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gh-ink) !important;
  background: none !important;
  border: 0 !important;
  border-left: 4px solid var(--sd-blue) !important;
}

.gh-sd-modal h3 small {
  font-size: 12px;
  font-weight: 400;
  color: var(--gh-sub);
}

.gh-sd-mnote {
  margin: 12px 0 0 !important;
  font-size: 12px;
  color: var(--gh-sub);
}

/* 血統 */
.gh-sd-ped {
  display: grid;
  grid-template-columns: 1fr 2.3fr;
  gap: 16px;
  align-items: center;
}

.gh-sd-ped.is-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* 黒毛和種の血統（4代・16行） */
.gh-sd-ped.is-black {
  grid-template-columns: 0.9fr 1fr 1fr 1fr;
  grid-template-rows: repeat(16, auto);
  gap: 4px 10px;
  align-items: stretch;
}

.gh-sd-ped.is-black .gh-sd-ped__b {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gh-sd-ped.is-black .gh-sd-ped__b.is-s {
  padding: 4px 8px;
  font-size: 11.5px;
}

.gh-sd-ped.is-black .gh-sd-ped__b.is-s span {
  font-size: 10px;
}

/* ホルスタインの血統（4段） */
.gh-sd-ped.is-hol {
  grid-template-columns: 1fr 1.3fr;
  grid-template-rows: repeat(4, auto);
  gap: 8px 16px;
  align-items: stretch;
}

.gh-sd-ped.is-hol.has-g3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.gh-sd-ped.is-hol .gh-sd-ped__b.is-p {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gh-sd-ped__b em {
  font-style: normal;
  font-weight: 400;
}

.gh-sd-ped__c1,
.gh-sd-ped__c2,
.gh-sd-ped__c3 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gh-sd-ped__b {
  padding: 10px 14px;
  font-weight: 700;
  line-height: 1.45;
  background: var(--sd-field);
  border: 1px solid var(--sd-line);
  border-radius: 6px;
}

.gh-sd-ped__b.is-p {
  background: var(--sd-pale);
}

/* オス：青系／メス：ピンク系 */
.gh-sd-ped__b.is-m {
  background: #edf5fc;
  border-color: #c9ddef;
}

.gh-sd-ped__b.is-f {
  background: #fdf1f4;
  border-color: #f1d2db;
}

.gh-sd-ped__b.is-m span {
  color: var(--sd-blue);
}

.gh-sd-ped__b.is-f span {
  color: #c4497a;
}

.gh-sd-ped__b.is-s {
  padding: 6px 10px;
  font-size: 12px;
}

.gh-sd-ped__b span {
  display: block;
  font-size: 11px;
  color: var(--gh-cyan);
}

.gh-sd-ped__b small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--gh-sub);
}

/* 指数のタイル */
.gh-sd-ntp {
  display: grid;
  grid-template-columns: 1fr 2.3fr;
  gap: 16px;
  margin-bottom: 12px;
}

.gh-sd-ntp__main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  color: #fff;
  background: var(--sd-blue);
  border-radius: 8px;
}

.gh-sd-ntp__main span {
  font-size: 13px;
  font-weight: 700;
}

.gh-sd-ntp__main strong {
  font-size: 40px;
  line-height: 1.2;
}

.gh-sd-ntp__main small {
  font-size: 12px;
  opacity: 0.85;
}

.gh-sd-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gh-sd-tiles.is-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gh-sd-tile {
  padding: 10px 12px;
  background: var(--sd-field);
  border-radius: 6px;
}

.gh-sd-tile span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gh-sub);
}

.gh-sd-tile strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.gh-sd-tile strong small {
  font-size: 14px;
  font-weight: 700;
}


/* 産乳能力 */
.gh-sd-perfs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.gh-sd-perf {
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
}

.gh-sd-perf h4 {
  margin: 0 !important;
  padding: 10px 16px !important;
  font-size: 14px;
  font-weight: 700;
  color: var(--sd-blue);
  background: var(--sd-pale) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--sd-line) !important;
}

.gh-sd-perf h4::before,
.gh-sd-perf h4::after {
  content: none !important;
}

.gh-sd-perf table {
  width: 100%;
  margin: 0 !important;
  border-collapse: collapse;
}

.gh-sd-perf th,
.gh-sd-perf td {
  padding: 8px 16px !important;
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--sd-line) !important;
  font-variant-numeric: tabular-nums;
}

.gh-sd-perf th {
  width: 4em;
  white-space: nowrap;
  font-size: 12px;
  color: var(--gh-sub);
  text-align: left;
}

.gh-sd-perf td:nth-child(2) {
  font-weight: 700;
  text-align: right;
}

.gh-sd-perf p {
  margin: 0 !important;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--gh-sub);
  background: var(--sd-field);
}

/* 線形形質 */
.gh-sd-sbv {
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
}

.gh-sd-sbv__row {
  display: grid;
  grid-template-columns: 9em 4em 1fr 4em 5em;
  gap: 10px;
  align-items: center;
  padding: 4px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--sd-line);
}

.gh-sd-sbv__row:last-child {
  border-bottom: 0;
}

.gh-sd-sbv__row.is-head {
  padding: 10px 14px;
  font-weight: 700;
  color: var(--sd-blue);
  background: var(--sd-pale);
}

.gh-sd-sbv__row.is-mark {
  background: #fff3cd;
}

.gh-sd-sbv__name {
  font-weight: 700;
}

.gh-sd-sbv__lo {
  text-align: right;
  color: var(--gh-sub);
}

.gh-sd-sbv__hi {
  color: var(--gh-sub);
}

.gh-sd-sbv__bar {
  position: relative;
  height: 14px;
  background: #e6ebef;
  border-radius: 999px;
}

.gh-sd-sbv__bar::before {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: #9aa6b1;
}

.gh-sd-sbv__bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--sd-blue);
}

.gh-sd-sbv__bar i.is-neg {
  background: var(--sd-neg);
}

.gh-sd-sbv__axis {
  position: relative;
  height: 1.2em;
}

.gh-sd-sbv__axis span {
  position: absolute;
  transform: translateX(-50%);
}

.gh-sd-sbv__v {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 枝肉成績などの表 */
.gh-sd-tscroll {
  overflow-x: auto;
}

.gh-sd-ctable {
  width: 100%;
  margin: 0 !important;
  border-collapse: collapse;
  font-size: 13px;
}

.gh-sd-ctable.is-wide {
  min-width: 760px;
}

.gh-sd-ctable th,
.gh-sd-ctable td {
  padding: 9px 12px !important;
  text-align: right;
  white-space: nowrap;
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--sd-line) !important;
  font-variant-numeric: tabular-nums;
}

.gh-sd-ctable thead th {
  font-size: 12px;
  color: var(--sd-blue);
  background: var(--sd-pale) !important;
}

.gh-sd-ctable th small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--gh-sub);
}

.gh-sd-ctable tbody th {
  font-size: 12px;
  color: var(--gh-sub);
  text-align: left;
}

/* レーダー */
.gh-sd-radar {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 24px;
  align-items: center;
}

.gh-sd-radar svg {
  width: 100%;
  height: auto;
}

.gh-sd-radar .g {
  fill: none;
  stroke: #d5dde4;
}

.gh-sd-radar .v {
  fill: rgb(13 100 169 / 25%);
  stroke: var(--sd-blue);
  stroke-width: 2;
}

.gh-sd-radar text {
  font-size: 11px;
  fill: var(--gh-ink);
}

.gh-sd-radar ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  font-size: 13px;
}

.gh-sd-radar li {
  padding: 4px 0;
  border-bottom: 1px solid var(--sd-line);
}

.gh-sd-radar li::before {
  content: none !important;
}

/* 動画・関連情報 */
.gh-sd-video {
  aspect-ratio: 16 / 9;
}

.gh-sd-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.gh-sd-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.gh-sd-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-weight: 700;
  color: var(--gh-ink) !important;
  text-decoration: none !important;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.gh-sd-links a:hover {
  border-color: var(--sd-blue);
}

.gh-sd-links a > span:last-child {
  margin-left: auto;
  color: var(--sd-blue);
}

.gh-sd-links__tag {
  flex-shrink: 0;
  padding: 1px 10px;
  font-size: 11px;
  color: #fff;
  background: var(--gh-navy);
  border-radius: 999px;
}

/* 並べ替えの印 */
.gh-sd-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
}

.gh-sd-sorti {
  font-style: normal;
  font-size: 10px;
  opacity: 0.55;
}

.gh-sd-sorti.is-on {
  opacity: 1;
}

/* 表の下の注記・チェックの解除 */
.gh-sd-notes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
}

.gh-sd-notes p {
  margin: 0 !important;
  font-size: 12px;
  color: var(--gh-sub);
}

.gh-sd-uncheck {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sd-blue) !important;
  background: #fff;
  border: 1px solid var(--sd-blue);
  border-radius: 999px;
}

.gh-sd-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

/* 詳細を開く：セル全体を押しやすく */
.gh-sd-open {
  display: block;
  min-height: 32px;
  padding: 6px 0 !important;
}

/* 詳細の下の「一覧に戻る」 */
.gh-sd-mfoot {
  margin-top: 48px;
  text-align: center;
}

.gh-sd-modal .gh-sd-mfoot .gh-sd-mback {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 14px 48px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff !important;
  background: var(--sd-blue);
  border-radius: 999px;
}

/* キーボード操作のときの枠 */
.gh-sd :is(button, input, select, a):focus-visible,
.gh-sd-modal :is(button, a):focus-visible,
.gh-sd-scroll:focus-visible {
  outline: 3px solid var(--gh-cyan);
  outline-offset: 2px;
}

/* 見出し右のボタン（比べる・CSV・PDF） */
.gh-sd-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.gh-sd-csv,
.gh-sd-cmp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 700;
  color: var(--sd-blue) !important;
  background: #fff;
  border: 1px solid var(--sd-blue);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.gh-sd-cmp {
  color: #fff !important;
  background: var(--sd-blue);
}

.gh-sd-csv:hover {
  color: #fff !important;
  background: var(--sd-blue);
}

.gh-sd-cmp:hover {
  opacity: 0.85;
}

.gh-sd-actions small {
  padding: 1px 8px;
  font-size: 11px;
  color: #fff;
  background: #ef8a00;
  border-radius: 999px;
}

/* 横並びの比較 */
.gh-sd-mbody.is-compare h2 {
  font-size: 22px;
}

.gh-sd-cmp-scroll {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
}

.gh-sd-cmp__table {
  width: max-content;
  min-width: 100%;
  margin: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.gh-sd-cmp__table th,
.gh-sd-cmp__table td {
  padding: 8px 12px !important;
  background: #fff;
  border: 0 !important;
  border-bottom: 1px solid var(--sd-line) !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gh-sd-cmp__table tbody tr:nth-child(even) td {
  background: #f9fbfc;
}

.gh-sd-cmp__table tbody th,
.gh-sd-cmp__corner {
  position: sticky;
  left: 0;
  z-index: 1;
  font-size: 12px;
  color: var(--gh-sub);
  text-align: left;
  background: var(--sd-pale) !important;
}

.gh-sd-cmp__table tbody th small {
  font-size: 10px;
  font-weight: 400;
}

.gh-sd-cmp__table thead th {
  width: 170px;
  min-width: 150px;
  vertical-align: top;
  text-align: left;
  white-space: normal;
}

.gh-sd-cmp__table thead th img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  margin-bottom: 6px;
  object-fit: cover;
  border-radius: 6px;
}

.gh-sd-cmp__noimg {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--gh-sub);
  background: var(--sd-field);
  border-radius: 6px;
}

.gh-sd-cmp__code {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--gh-sub);
}

.gh-sd-cmp__table thead strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.gh-sd-cmp-open {
  margin-top: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sd-blue) !important;
  background: #fff;
  border: 1px solid var(--sd-blue);
  border-radius: 999px;
}

.gh-sd-cmp__table .is-num {
  text-align: right;
}

/* ---------- スマホ ---------- */
@media (max-width: 767px) {
  .gh-sd-tab { font-size: 15px !important; padding: 10px 4px; line-height: 1.3; }
  .gh-sd-tab__sub { display: block; font-size: 11px; }
  .gh-sd-subs { padding: 10px; gap: 6px; }
  .gh-sd-sub { padding: 6px 14px; font-size: 13px; }
  .gh-sd-head { align-items: flex-start; flex-direction: column; margin-top: 24px; }
  .gh-sd .gh-sd-title { font-size: 21px; }
  .gh-sd-filter__head { padding: 16px; }
  .gh-sd-filter__body { padding: 0 16px 16px; }
  .gh-sd-frow { grid-template-columns: 1fr; gap: 6px; }
  .gh-sd-range select { width: 100%; }
  .gh-sd-range input { width: calc(50% - 22px); }
  .gh-sd-scroll { max-height: 75vh; }
  /* スマホは「チェック＋名前」を固定し、略号は流す */
  .gh-sd-table .is-sticky:not(.is-sticky2) { position: static; }
  .gh-sd-table .is-sticky2 { left: 44px; }
  .gh-sd-table thead .is-sticky:not(.is-sticky2) { position: sticky; left: auto; }
  .gh-sd-kw,
  .gh-sd-range select,
  .gh-sd-range input { font-size: 16px; }
  .gh-sd-check { width: 24px; height: 24px; }
  .gh-sd-sbv__row { grid-template-columns: 3.4em 1fr 3.4em; grid-template-areas: "n n v" "l b h"; row-gap: 2px; }
  .gh-sd-sbv__row > :nth-child(1) { grid-area: n; }
  .gh-sd-sbv__row > :nth-child(2) { grid-area: l; font-size: 10px; }
  .gh-sd-sbv__row > :nth-child(3) { grid-area: b; }
  .gh-sd-sbv__row > :nth-child(4) { grid-area: h; font-size: 10px; }
  .gh-sd-sbv__row > :nth-child(5) { grid-area: v; }

  .gh-sd-modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .gh-sd-mbody { padding: 16px 16px 40px; }
  .gh-sd-mtools { position: sticky; top: 0; z-index: 2; margin: -16px -16px 16px; padding: 10px 16px; background: rgb(255 255 255 / 95%); }
  .gh-sd-mpdf { padding: 8px 14px; font-size: 13px; }
  .gh-sd-mtop,
  .gh-sd-ped,
  .gh-sd-ped.is-3,
  .gh-sd-ntp,
  .gh-sd-perfs,
  .gh-sd-radar,
  .gh-sd-links { grid-template-columns: 1fr; }
  .gh-sd-mtop { gap: 20px; }
  .gh-sd-ped.is-hol,
  .gh-sd-ped.is-hol.has-g3 { grid-template-columns: 1fr; }
  .gh-sd-ped.is-hol .gh-sd-ped__b { grid-area: auto !important; }
  .gh-sd-ped.is-black { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .gh-sd-ped.is-black .gh-sd-ped__b { grid-area: auto !important; }
  .gh-sd-modal h2 { font-size: 22px; }
  .gh-sd-msec { margin-top: 36px; }
  .gh-sd-tiles,
  .gh-sd-tiles.is-4 { grid-template-columns: repeat(2, 1fr); }
  .gh-sd-sbv__row { gap: 2px 6px; padding: 5px 10px; }
  .gh-sd-mfoot .gh-sd-mback { width: 100%; }
  .gh-sd-actions { justify-content: flex-start; }
  .gh-sd-csv, .gh-sd-cmp, .gh-sd-pdf { padding: 8px 14px; font-size: 13px; }
  .gh-sd-cmp__table thead th { width: 130px; min-width: 120px; }
}

/* ---------- PDF出力（印刷） ---------- */
.gh-sd-print {
  display: none;
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }

  body.gh-sd-printing-list > *:not(.gh-sd-print) { display: none !important; }
  body.gh-sd-printing-list .gh-sd-print { display: block; font-size: 8pt; color: #000; }
  .gh-sd-print h1 { margin: 0 0 2mm; font-size: 14pt; }
  .gh-sd-print p { margin: 0 0 3mm; font-size: 8pt; }
  .gh-sd-print table { width: 100%; border-collapse: collapse; }
  .gh-sd-print th,
  .gh-sd-print td { padding: 1.2mm 1.5mm; border: 0.2mm solid #999; white-space: nowrap; }
  .gh-sd-print th { background: #e8eef4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gh-sd-print th small { display: block; font-weight: 400; }
  .gh-sd-print .is-num { text-align: right; }
  .gh-sd-print thead { display: table-header-group; }
  .gh-sd-print tr { break-inside: avoid; }
  .gh-sd-print .gh-sd-badge { padding: 0 1mm; font-size: 6.5pt; color: #000; background: none !important; border: 0.2mm solid #666; }

  body.gh-sd-printing-modal > *:not(.gh-sd-modal) { display: none !important; }
  body.gh-sd-printing-modal { background: #fff !important; }
  body.gh-sd-printing-modal .gh-sd-modal {
    position: static;
    width: 100%;
    max-height: none;
    height: auto;
    overflow: visible;
    border-radius: 0;
  }
  body.gh-sd-printing-modal .gh-sd-modal::backdrop { background: #fff; }
  .gh-sd-modal * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gh-sd-mbody { padding: 0; font-size: 9pt; }
  .gh-sd-cmp-scroll { overflow: visible; }
  .gh-sd-cmp__table { width: 100%; font-size: 8pt; }
  .gh-sd-cmp-open,
  .gh-sd-mfoot,
  .gh-sd-mtools,
  .gh-sd-slide-prev,
  .gh-sd-slide-next,
  .gh-sd-thumbs,
  .gh-sd-msec:has(.gh-sd-video) { display: none !important; }
  .gh-sd-mtop { grid-template-columns: 1fr 1fr; }
  .gh-sd-msec { margin-top: 6mm; break-inside: avoid; }
  .gh-sd-ped.is-hol.has-g3 { grid-template-columns: 1fr 1fr 1fr !important; }
  .gh-sd-ntp { grid-template-columns: 1fr 2.3fr; }
  .gh-sd-ped.is-hol { grid-template-columns: 1fr 1.3fr; }
  .gh-sd-ped.is-black { grid-template-columns: 0.9fr 1fr 1fr 1fr; }
  .gh-sd-perfs, .gh-sd-links { grid-template-columns: 1fr 1fr; }
  .gh-sd-tiles.is-4 { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================
   スマホ：文字を一回り小さく、余白を詰めて情報を見やすく
   ========================================================= */
@media (max-width: 767px) {
  /* ページの白い枠 */
  .gh-card:has(.gh-sd) { padding: 16px 12px; }

  .gh-sd { font-size: 12.5px; }

  /* タブ */
  .gh-sd-tab { padding: 8px 4px; font-size: 14px !important; border-radius: 10px 10px 0 0; }
  .gh-sd-tab__sub { font-size: 10px; }
  .gh-sd-subs { gap: 4px; padding: 8px; }
  .gh-sd-sub { padding: 5px 12px; font-size: 12px; }

  /* 見出し・ボタン */
  .gh-sd-head { gap: 10px; margin: 18px 0 14px; }
  .gh-sd .gh-sd-title { font-size: 18px; }
  .gh-sd-meta { font-size: 12px; }
  .gh-sd-meta > span:not(.gh-sd-count) { margin: 0 8px; }
  .gh-sd-actions { gap: 6px; }
  .gh-sd-csv, .gh-sd-cmp, .gh-sd-pdf { padding: 6px 12px; font-size: 12px; }
  .gh-sd-actions small { font-size: 10px; }

  /* 絞り込み */
  .gh-sd-filter { margin-bottom: 16px; border-radius: 12px; }
  .gh-sd-filter__head { padding: 12px 14px; font-size: 14px !important; }
  .gh-sd-filter__head span { font-size: 12px; }
  .gh-sd-filter__body { padding: 0 14px 14px; }
  .gh-sd-frow { gap: 4px; margin-bottom: 12px; }
  .gh-sd-flabel { font-size: 12px; }
  .gh-sd-kw, .gh-sd-range select, .gh-sd-range input { height: 36px; padding: 0 10px; }
  .gh-sd-chips { gap: 6px; }
  .gh-sd-chip { padding: 4px 10px; font-size: 12px; }
  .gh-sd-switch { gap: 8px; font-size: 12px; }
  .gh-sd-switches { gap: 8px; }

  /* 一覧の表 */
  .gh-sd-hint, .gh-sd-note, .gh-sd-notes p, .gh-sd-legend { font-size: 11px; }
  .gh-sd-table { font-size: 12px; }
  .gh-sd-table th, .gh-sd-table td { padding: 6px 7px; }
  .gh-sd-table thead th { font-size: 11px; }
  .gh-sd-c-check, .gh-sd-table .gh-sd-c-check { width: 38px; min-width: 38px; max-width: 38px; }
  .gh-sd-table .is-sticky2 { left: 38px; }
  .gh-sd-check { width: 20px; height: 20px; }
  .gh-sd-open { min-height: 28px; padding: 4px 0 !important; }
  .gh-sd-sort { min-height: 28px; }
  .gh-sd-badge { padding: 0 5px; font-size: 10px; }
  .gh-sd-legend { gap: 4px 12px; }

  /* 詳細・比較 */
  .gh-sd-mbody { padding: 12px 12px 28px; font-size: 12.5px; }
  .gh-sd-mtools { margin: -12px -12px 12px; padding: 8px 12px; }
  .gh-sd-mpdf { padding: 6px 12px; font-size: 12px; }
  .gh-sd-mclose { width: 34px; height: 34px; font-size: 22px; }
  .gh-sd-mtop { gap: 14px; }
  .gh-sd-mlabel { font-size: 11px; }
  .gh-sd-modal h2 { font-size: 19px; }
  .gh-sd-mbody.is-compare h2 { font-size: 17px; }
  .gh-sd-info th, .gh-sd-info td { padding: 7px 0 !important; font-size: 12px; }
  .gh-sd-msec { margin-top: 26px; }
  .gh-sd-modal h3 { margin-bottom: 12px !important; padding-left: 10px !important; font-size: 15px; }
  .gh-sd-mnote { font-size: 11px; }
  .gh-sd-ped { gap: 6px; }
  .gh-sd-ped__b { padding: 7px 10px; }
  .gh-sd-ntp { gap: 8px; }
  .gh-sd-ntp__main { padding: 14px 16px; }
  .gh-sd-ntp__main strong { font-size: 30px; }
  .gh-sd-tiles, .gh-sd-tiles.is-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .gh-sd-tile strong small { display: block; font-size: 10px; font-weight: 400; color: var(--gh-sub); }
  .gh-sd-tile { padding: 7px 9px; }
  .gh-sd-tile span { font-size: 10px; }
  .gh-sd-tile strong { font-size: 15px; }
  .gh-sd-perfs { gap: 10px; }
  .gh-sd-perf h4 { padding: 8px 12px !important; font-size: 13px; }
  .gh-sd-perf th, .gh-sd-perf td { padding: 6px 12px !important; }
  .gh-sd-perf p { padding: 6px 12px; font-size: 11px; }
  .gh-sd-sbv__row { font-size: 11px; padding: 4px 8px; }
  .gh-sd-ctable { font-size: 12px; }
  .gh-sd-ctable th, .gh-sd-ctable td { padding: 6px 8px !important; }
  .gh-sd-links { gap: 8px; }
  .gh-sd-links a { padding: 10px 12px; font-size: 13px; }
  .gh-sd-mfoot { margin-top: 28px; }
  .gh-sd-modal .gh-sd-mfoot .gh-sd-mback { padding: 11px 32px; font-size: 14px; }
  .gh-sd-cmp__table { font-size: 12px; }
  .gh-sd-cmp__table th, .gh-sd-cmp__table td { padding: 6px 8px !important; }
  .gh-sd-cmp__table thead th { width: 115px; min-width: 105px; }
  .gh-sd-cmp__table thead strong { font-size: 12.5px; }
}

/* ダウンロードの印（フォントに頼らずSVGで表示） */
.gh-sd-dl {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 並べ替えできる印（上下の矢印。フォントに頼らずSVGで表示） */
.gh-sd-sorti.is-both {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 系統別の成績（系統ごとに全体・去勢・雌の表） */
.gh-sd-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.gh-sd-line h4 {
  margin: 0 0 6px !important;
  padding: 0 !important;
  font-size: 14px;
  font-weight: 700;
  color: var(--sd-blue);
  background: none !important;
  border: 0 !important;
}

.gh-sd-line h4::before,
.gh-sd-line h4::after {
  content: none !important;
}

/* レーダーの0の線 */
.gh-sd-radar .g.is-zero {
  stroke: #9aa6b1;
  stroke-width: 1.5;
}

/* 線形形質の★ */
.gh-sd-sbv__bar {
  overflow: visible;
}

.gh-sd-sbv__star {
  position: absolute;
  top: 50%;
  z-index: 1;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  color: #e0a100;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}

/* アイコンの判定基準（開閉） */
.gh-sd-criteria {
  margin-top: 10px;
  font-size: 12px;
  color: var(--gh-sub);
}

.gh-sd-criteria summary {
  display: inline-block;
  font-weight: 700;
  color: var(--sd-blue);
  cursor: pointer;
}

.gh-sd-criteria > div {
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--sd-field);
  border-radius: 8px;
}

.gh-sd-criteria h4 {
  margin: 10px 0 4px !important;
  padding: 0 !important;
  font-size: 12px;
  font-weight: 700;
  color: var(--gh-ink);
  background: none !important;
  border: 0 !important;
}

.gh-sd-criteria h4::before,
.gh-sd-criteria h4::after,
.gh-sd-criteria li::before {
  content: none !important;
}

.gh-sd-criteria p,
.gh-sd-criteria ul {
  margin: 0 !important;
  padding-left: 0 !important;
  list-style: none;
}

@media (max-width: 767px) {
  .gh-sd-lines { grid-template-columns: 1fr; }
}

@media print {
  .gh-sd-lines { grid-template-columns: 1fr 1fr; }
  .gh-sd-criteria { display: none; }
}
