/* 장비 판정 — 허브와 상세 두 화면.
 *
 * 색은 전부 style.css 의 토큰만 쓴다. 하드코딩 hex 를 쓰면 sync_theme.py 가
 * 다음 실행에서 토큰으로 바꿔 버리고, 그 과정에서 의도한 색이 아닌 값이
 * 들어앉는다. 판정 색도 토큰으로 간다 —
 *   통과 --trail / 위반 --accent-ink / 갈림·의무 --warn-ink / 모름 --ink-faint
 * 어두운 모드 값이 토큰 쪽에 이미 정의돼 있어서, 여기서 모드를 다시
 * 분기하지 않아도 양쪽 다 대비가 선다.
 *
 * 색만으로 판정을 전달하지 않는다. 통과·위반은 언제나 글자로 먼저 적고
 * 색은 거드는 역할만 한다. 색을 못 가리는 사람에게도 결과가 남아야 한다. */

/* ── 공통 ──────────────────────────────────────────────────── */
.gi-headline:empty, .gi-meta:empty, .gi-hub:empty, .gi-result:empty { display: none; }
.gi-back { display: none; }
body.ge-detail-mode .gi-intro { display: none; }
body.ge-detail-mode .gi-back { display: block; }
body.ge-hub-mode .gi-form-wrap { display: none; }

.gi-headline {
  max-width: 640px; margin: 18px auto 0;
  font-size: 19px; font-weight: 700; line-height: 1.6;
  color: var(--ink); text-wrap: balance; text-align: center;
}
.gi-intro {
  max-width: 640px; margin: 20px auto 0;
  font-size: 15.5px; line-height: 1.85; color: var(--ink-soft);
}
.gi-intro p + p { margin-top: 12px; }
.gi-intro b { color: var(--ink); }

.gi-back { max-width: 640px; margin: 34px auto 0; }
.gi-back a {
  font-size: 15px; color: var(--ink-faint); text-decoration: none;
}
.gi-back a:hover { color: var(--accent-ink); }

.gi-sec { max-width: 640px; margin: 46px auto 0; }
.gi-sec h2 { font-size: 18px; margin-bottom: 10px; }
.gi-sec p { font-size: 15.5px; line-height: 1.85; color: var(--ink-soft); }
.gi-sec p + p { margin-top: 11px; }
.gi-sec b { color: var(--ink); }

.gi-links { max-width: 640px; margin: 34px auto 0; font-size: 15px; line-height: 2; }
.gi-links a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px dashed var(--ink-faint);
}
.gi-links a:hover { color: var(--accent-ink); border-color: var(--accent); }

/* 빵부스러기 — 생성기가 찍는 정적 페이지에만 있다. 검색 결과에서 바로
   들어온 사람이 "여기가 어디의 무엇인지"를 첫 줄에서 알게 한다. */
.gi-crumb {
  max-width: 760px; margin: 16px auto 4px; font-size: 13.5px; color: var(--ink-faint);
}
.gi-crumb a { color: var(--ink-faint); text-decoration: none; display: inline-block; padding-block: 11px; }
.gi-crumb a:hover { color: var(--accent-ink); }

/* ── 허브: 종목 × 두 축 ─────────────────────────────────────── */
.gi-hub { max-width: 760px; margin: 28px auto 0; }
.gh-sport {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px 18px; margin-bottom: 14px; background: var(--surface);
}
.gh-sport h2 {
  font-size: 17px; margin: 0 0 14px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
}
.gh-body {
  font-size: 13px; font-weight: 400; color: var(--ink-faint);
  letter-spacing: .01em;
}
.gh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gh-col h3 {
  font-size: 13.5px; color: var(--ink-faint); font-weight: 700;
  margin: 0 0 9px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.gh-col h3 small { font-size: 12.5px; font-weight: 400; color: var(--ink-faint); }

.gh-item {
  display: block; text-decoration: none; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 7px;
  background: var(--tint-1);
}
.gh-item:hover { border-color: var(--accent); background: var(--tint-2); }
.gh-item b { display: block; font-size: 15px; color: var(--ink); }
/* 목록 카드의 이모지는 칸을 같은 크기로 고정해, 이름 글자가 항상 같은 선에서 시작하게 한다. */
.gh-item b .gh-emo.emo { width: 24px; height: 24px; margin: 0; vertical-align: baseline; }
.gh-sport h2 { align-items: center; }
/* 설명과 태그도 제목 글자와 같은 왼쪽 선에서 시작하게 한다(이모지 24px + 간격 10px). */
.gh-sport h2 .emo { align-self: center; margin-right: 0; width: 26px; height: 26px; vertical-align: baseline; }
.gh-q {
  display: block; font-size: 13.5px; line-height: 1.6;
  color: var(--ink-soft); margin-top: 4px;
}
.gh-tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  color: var(--on-accent); background: var(--accent-fill);
  padding: 1px 6px; border-radius: 999px; margin-top: 5px;
}
.gh-empty {
  font-size: 13.5px; line-height: 1.7; color: var(--ink-faint);
  padding: 10px 2px; margin: 0;
}

/* ── 입력 ──────────────────────────────────────────────────── */
.gi-form-wrap { max-width: 640px; margin: 24px auto 0; }
.gi-form {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 14px;
  align-items: center; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; background: var(--surface);
}
.gi-form label { font-size: 15px; font-weight: 700; color: var(--ink); }
.gf-unit { font-weight: 400; color: var(--ink-faint); }
.gi-form input, .gi-form select {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--ink);
}
.gi-form input:focus, .gi-form select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* ── 규정 판정 결과 ─────────────────────────────────────────── */
.gi-result { max-width: 640px; margin: 20px auto 0; }
.gr-hint, .ge-cond {
  font-size: 15px; line-height: 1.8; color: var(--ink-faint);
  text-align: center; margin: 0;
}
.ge-cond { color: var(--ink-soft); }
.ge-cond b { color: var(--ink); }

.gr-verdict {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: center; gap: 10px;
  border: 2px solid var(--border); border-radius: 12px;
  padding: 18px 20px; background: var(--surface);
}
.gr-word { font-size: 28px; font-weight: 900; letter-spacing: -.01em; }
.gr-input { font-size: 15px; color: var(--ink-faint); }
.gr-ok  { border-color: var(--trail); }
.gr-ok  .gr-word { color: var(--trail); }
.gr-no  { border-color: var(--accent); }
.gr-no  .gr-word { color: var(--accent-ink); }
.gr-mix { border-color: var(--warn-ink); }
.gr-mix .gr-word { color: var(--warn-ink); }
.gr-un  .gr-word { color: var(--ink-faint); }

.gr-band {
  font-size: 15px; line-height: 1.8; color: var(--ink-soft);
  margin: 13px 0 0; padding: 12px 14px;
  border-left: 3px solid var(--warn-ink); background: var(--tint-1);
}
.gr-band b { color: var(--ink); }

.gr-rows { list-style: none; padding: 0; margin: 14px 0 0; }
.gr-rows li {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px;
  padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 7px; background: var(--surface);
}
.gr-scope { font-size: 15px; font-weight: 700; color: var(--ink); }
.gr-mark { font-size: 14.5px; font-weight: 700; text-align: right; }
.gr-rows li.gr-ok  .gr-mark { color: var(--trail); }
.gr-rows li.gr-no  .gr-mark { color: var(--accent-ink); }
.gr-rows li.gr-un  .gr-mark { color: var(--ink-faint); }
.gr-rows li.gr-no  { border-color: var(--accent); }
.gr-lim, .gr-free {
  grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-soft);
}
.gr-lim em { font-style: normal; color: var(--accent-ink); font-weight: 700; }
.gr-rnote {
  grid-column: 1 / -1; font-size: 13.5px; line-height: 1.7;
  color: var(--ink-faint); margin-top: 3px;
}
.gr-mixnote {
  font-size: 15px; line-height: 1.8; color: var(--ink-soft);
  margin: 12px 0 0; padding: 12px 14px;
  border-left: 3px solid var(--warn-ink); background: var(--tint-1);
}

/* ── 규정 전문 ─────────────────────────────────────────────── */
.gi-meta { max-width: 640px; margin: 36px auto 0; }
.gi-meta h2 {
  font-size: 15px; margin: 28px 0 10px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.gi-meta h2:first-child { margin-top: 0; }
.gm-surprise {
  font-size: 15.5px; line-height: 1.9; color: var(--ink-soft);
  margin: 0 0 4px; padding: 14px 16px;
  border-left: 3px solid var(--accent); background: var(--tint-1);
  border-radius: 0 8px 8px 0;
}
.gm-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.gm-table th, .gm-table td {
  text-align: left; vertical-align: top; padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
}
.gm-table th { font-weight: 700; color: var(--ink); width: 42%; }
.gm-table td { color: var(--ink-soft); }
.gm-note {
  display: block; font-size: 13.5px; line-height: 1.7;
  color: var(--ink-faint); margin-top: 4px;
}
.gm-measure, .gm-body, .gm-src {
  font-size: 15px; line-height: 1.85; color: var(--ink-soft); margin: 0;
}
.gm-body b { color: var(--ink); }
.gm-src { font-size: 13.5px; color: var(--ink-faint); margin-top: 24px; }
.gm-src a { color: var(--accent-ink); }

/* ── 효과 판정 ─────────────────────────────────────────────── */
.ge-eff {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-top: 16px; background: var(--surface);
}
.ge-eff h3 {
  font-size: 15px; margin: 0 0 10px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px;
}
.ge-detail { font-size: 13.5px; font-weight: 400; color: var(--ink-faint); }
.ge-big { font-size: 15px; line-height: 1.7; margin: 0; color: var(--ink-soft); }
.ge-big strong { font-size: 22px; font-weight: 900; color: var(--ink); }
.ge-ns {
  display: block; font-style: normal; font-size: 13.5px; line-height: 1.7;
  color: var(--warn-ink); font-weight: 700; margin-top: 5px;
}
.ge-time, .ge-grade-move, .ge-value {
  font-size: 15px; line-height: 1.8; color: var(--ink-soft); margin: 9px 0 0;
}
.ge-time strong, .ge-grade-move b, .ge-value b { color: var(--ink); }
.ge-note, .ge-none {
  font-size: 13.5px; line-height: 1.75; color: var(--ink-faint); margin: 10px 0 0;
}
.ge-empty { border-style: dashed; }
.ge-gap {
  font-size: 15px; line-height: 1.85; color: var(--ink-soft);
  margin: 0; padding: 13px 15px;
  border-left: 3px solid var(--warn-ink); background: var(--tint-1);
}
.ge-gap b { color: var(--ink); }

.ge-src {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
}
.ge-grade {
  display: inline-block; font-size: 13px; font-weight: 900;
  padding: 2px 8px; border-radius: 999px; margin-right: 7px;
  color: var(--on-accent); background: var(--ink-faint);
}
.ge-A { background: var(--trail); }
.ge-B { background: var(--forecast); }
.ge-C { background: var(--warn-ink); color: var(--bg); }
.ge-D { background: var(--ink-faint); }
.ge-meta { font-size: 13.5px; color: var(--ink-soft); }
.ge-cite {
  font-size: 13px; line-height: 1.7; color: var(--ink-faint); margin: 9px 0 0;
}
.ge-cite a { color: var(--accent-ink); white-space: nowrap; }

/* ── 근거 지형 차트 ────────────────────────────────────────── */
.gc-wrap { margin: 16px 0 0; }
.gc { width: 100%; height: auto; display: block; overflow: visible; }
.gc-grid { stroke: var(--line); stroke-width: 1; }
.gc-ytick, .gc-xtick, .gc-badge, .gc-melabel {
  font-family: var(--font-body); fill: var(--ink-faint);
}
.gc-ytick { font-size: 12px; text-anchor: end; }
.gc-xtick { font-size: 12px; text-anchor: start; }
.gc-xtick.gc-end { text-anchor: end; }
.gc-badge { font-size: 11px; font-weight: 900; text-anchor: middle; fill: var(--ink-soft); }
.gc-melabel { font-size: 10.5px; font-weight: 700; text-anchor: middle; fill: var(--accent-ink); }
.gc-band { fill-opacity: .55; }
.gc-A { fill: var(--trail); }
.gc-B { fill: var(--forecast); }
.gc-C { fill: var(--warn-ink); }
.gc-D { fill: var(--ink-faint); }
.gc-ns { fill-opacity: .22; stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 3 2; }
.gc-me { stroke: var(--accent); stroke-width: 2; }
.gc-cap {
  font-size: 13px; line-height: 1.7; color: var(--ink-faint); margin-top: 8px;
}

/* ── 모바일 ────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .gh-cols { grid-template-columns: 1fr; gap: 18px; }
  .gh-sport { padding: 14px 15px 16px; }
  .gi-form { grid-template-columns: 1fr; gap: 4px; padding: 14px 15px; }
  .gi-form label { margin-top: 8px; }
  .gi-form label:first-child { margin-top: 0; }
  .gi-headline { font-size: 17px; }
  .gr-word { font-size: 24px; }
  .ge-big strong { font-size: 20px; }
  .gm-table th, .gm-table td { display: block; width: auto; padding-right: 0; }
  .gm-table th { border-bottom: 0; padding-bottom: 2px; }
  .gi-sec { margin-top: 36px; }
}

/* 생성기가 찍은 페이지에서는 위쪽 판정이 숫자만 낸다. 근거와 출처는
   바로 아래 본문에 있으니, 여기서는 등급만 달고 그쪽을 가리킨다. */
.ge-mini-src {
  margin: 12px 0 0; padding-top: 11px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-faint);
}

/* 주의사항 칸 — 효과가 아니라서 숫자를 내지 않는다. */
.ge-caveat { border-style: dashed; }

/* ── 기록별·평속별 효과표 ──────────────────────────────────────
 * 목표 시간 페이지와 같은 일을 한다 — 읽는 사람이 표에서 자기 줄을
 * 찾게 한다. 모바일에서 가로로 밀리게 두되, 밀린다는 걸 알 수 있게
 * 가장자리에 그늘을 준다. */
.gt-wrap {
  margin: 18px 0 0; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.gt {
  width: 100%; border-collapse: collapse; font-size: 15px;
  min-width: 460px;
}
.gt thead th {
  text-align: left; font-size: 13.5px; color: var(--ink-faint);
  font-weight: 700; padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.gt tbody th {
  text-align: left; font-weight: 700; color: var(--ink);
  padding: 11px 12px 11px 0; white-space: nowrap;
}
.gt tbody td {
  color: var(--ink-soft); padding: 11px 12px 11px 0; vertical-align: top;
}
.gt tbody tr + tr th, .gt tbody tr + tr td { border-top: 1px solid var(--line); }
.gt tbody td b { color: var(--ink); }
.gt tbody td em { font-style: normal; color: var(--ink-faint); }
.gt .ge-grade { margin-right: 0; }
.gt-ns {
  display: block; font-size: 12.5px; color: var(--warn-ink);
  font-weight: 700; margin-top: 3px; white-space: nowrap;
}

@media (max-width: 680px) {
  /* 좁은 화면에서 가로로 밀리면 맨 오른쪽 '등급' 칸이 잘린다. 그런데
     그 칸이 이 표의 요점이다 — 몇 초 줄어드는지보다 등급이 바뀌는지가
     사람들이 알고 싶은 것이다. 속도는 페이스에서 바로 나오는 값이라
     여기서만 접는다. 그러면 나머지가 화면 안에 들어온다. */
  .gt { font-size: 13.5px; min-width: 0; }
  .gt thead th, .gt tbody th, .gt tbody td { padding-right: 8px; }
  .gt thead th:nth-child(3), .gt tbody td:nth-child(3) { display: none; }
  .gt-ns { font-size: 12px; }
}

/* 표 페이지로 보내는 줄. 판정 머리 가까이 둔다. */
.gi-tablinks {
  margin: 0 0 16px; padding: 11px 14px; border-radius: 8px;
  background: var(--tint-1); font-size: 15px; line-height: 1.9;
  color: var(--ink-faint);
}
.gi-tablinks a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px dashed var(--ink-faint);
}
.gi-tablinks a:hover { color: var(--accent-ink); border-color: var(--accent); }

.gi-hero-img { margin: 0 0 20px; }
.gi-hero-img img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: 12px; background: var(--tint-1); }
.gi-hero-img figcaption { margin-top: 6px; font-size: 13.5px; color: var(--ink-faint); }
.gi-hero-img figcaption a { color: inherit; }

/* 자주 묻는 질문 · 규정과 효과 연결 */
.gi-faq h3 { font-size: 15px; margin: 18px 0 4px; color: var(--ink); }
.gi-pair ul { margin: 8px 0 0; padding-left: 18px; }
.gi-pair li { font-size: 15.5px; line-height: 1.9; }
.gi-pair a { color: var(--ink); border-bottom: 1px dashed var(--ink-faint); text-decoration: none; }
.gi-pair a:hover { color: var(--accent-ink); border-color: var(--accent); }
/* 허브 종목 제목: 이모지 + 제목 + 작은 설명이 한 줄에서 같은 세로 가운데에 놓이게 한다. */
.gh-sport h2:has(> .emo:first-child) { align-items: center; gap: 10px; flex-wrap: wrap; }
.gh-sport h2 > .gh-body { margin-left: 2px; }
