/* /tournament/shiaisu/ 専用（上の塊・答えの帯・計算機・本文の表・3位決定戦の追加）。共通の見た目は seo.css（docs/SEO_PAGE_DESIGN.md）。色は style.css のトークンだけ */

/* ---------- 上の塊（h1・リード文・案内ボックス）。/tournament/8/ と同じ（2026-10-24 オーナー指示: ページで一番強い塊にする） ---------- */
.seo-top { margin: 8px -8px 40px; padding: 24px 16px 16px; background: var(--card); border-top: 6px solid var(--sky); border-radius: 16px; box-shadow: var(--shadow-lg); }
.seo-top .seo-h1 { margin: 0 0 16px; font-size: 30px; line-height: 1.3; }
.seo-leadtext { margin: 0; font-size: 18px; line-height: 1.7; word-break: normal; overflow-wrap: anywhere; text-wrap: pretty; max-width: none !important; }
.seo-guide { margin: 24px 0 0; }
.sg-g + .sg-g { margin-top: 24px; }
.sg-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--sky-deep); max-width: none !important; }
.sg-no { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sky); color: #fff; font: 800 15px/1 var(--num); }
.seo-guide ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.seo-guide li { margin: 0; border-bottom: 1px solid var(--line); max-width: none !important; }
:where(body.seo) .seo-guide a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 28px 8px 0; position: relative; color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1.45; text-decoration: none; }
.seo-guide a::after { content: "↓"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--sky); font-weight: 800; }
.seo-guide a:hover .sg-t, .seo-guide a:focus-visible .sg-t { text-decoration: underline; text-underline-offset: 3px; }
.sg-t { word-break: normal; overflow-wrap: anywhere; }
.sg-mk { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 800 14px/1 var(--num); }
.sg-check .sg-mk { background: var(--sky-soft); }
.sg-check .sg-mk::before { content: ""; width: 10px; height: 6px; margin-top: -3px; border-left: 2.5px solid var(--sky); border-bottom: 2.5px solid var(--sky); transform: rotate(-45deg); }
.sg-num .sg-mk { border: 1.5px solid var(--sky); color: var(--sky-deep); border-radius: 50%; }
.seo-guide li.sg-plain { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
@media (min-width: 768px) {
  .seo-top { margin: 16px 0 40px; padding: 32px 32px 24px; }
  .seo-top .seo-h1 { font-size: 32px; }
  :where(body.seo) .seo-guide a { font-size: 18px; }
  .seo-guide li.sg-plain { font-size: 18px; }
}
/* PC（1024px以上）: 縦1列のまま（①→②→③が左右に振れないように）。幅760px */
@media (min-width: 1024px) {
  .seo-top { width: 760px; margin-left: calc(50% - 380px); }
}

/* 道具の節の見出し（tool.headingTop）: 図の上に h2 と1文。PCは2列の上に通しで置く */
.work-head { margin: 0 0 16px; }
.work-head .work-toph { margin: 0 0 8px; }
.work-head p { margin: 0; }
@media (min-width: 1024px) {
  body.seo-v2 .seo-work.has-toph { grid-template-areas: "head head" "ctrl fig" "ctrl can" "ctrl out"; }
  .seo-work.has-toph .work-head { grid-area: head; margin-bottom: 24px; }
}
@media print { html body.seo .work-head, html body.seo .seo-top { display: none !important; } }

/* 答えの帯と図は、上の塊より弱く。白地＋左の細い黄色の線だけ、数字も一段小さく */
body.seo-v2 .seo-ans { margin: 0 0 24px; padding: 8px 0 8px 16px; background: none; border-left: 3px solid var(--yellow); border-radius: 0; }
body.seo-v2 .seo-ans-t { font-size: 17px; }
body.seo-v2 .seo-ans-n dd b { font-size: 26px; }
body.seo-v2 .seo-ans-n dd small { font-size: 16px; }
body.seo-v2 .work-board .bk-wrap { background: none; border-color: transparent; padding: 0; }

/* ---------- 計算機（道具の節の h2 の下・図の上）---------- */
.work-head p.ts-lead1 { margin: 0 0 12px; }
.ts-calc { margin: 0 0 24px; padding: 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; }
.work-head .ts-calc p.ts-cond { margin: 0 0 8px; font-size: var(--fs-sub); color: var(--ink-2); }
.ts-form { margin: 0 0 4px; padding: 8px 12px 12px; background: var(--sky-soft); border-radius: 12px; }
.ts-form select, .ts-form input { background: #fff; width: 100%; }
.ts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ts-grid > div { min-width: 0; }
.ts-grid label { margin-top: 8px; }
.ts-grid label .hint { display: block; margin: 0; font-size: 12px; }
.ts-chk { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 8px 12px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; font-weight: 800; }
.ts-chk input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--sky); }
.ts-chk .hint { display: block; margin: 2px 0 0; font-weight: 400; }
.ts-chk:has(input:disabled) { opacity: .55; cursor: default; }
.ts-out { margin-top: 12px; }
.ts-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ts-big > div { background: var(--yellow-soft); border-radius: 12px; padding: 8px 10px; text-align: center; min-width: 0; }
.ts-big span { display: block; font-size: 14px; font-weight: 800; color: var(--ink-2); }
.ts-big b { display: block; font: 800 36px/1.15 var(--num); font-variant-numeric: tabular-nums; color: var(--ink); }
.ts-big b small.u { display: inline; font: 800 16px var(--font); margin-left: 2px; color: var(--ink); }
.ts-big small { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.ts-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 0; }
.ts-dl > div { border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 10px; min-width: 0; }
.ts-dl dt { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.ts-dl dd { margin: 0; font-size: 18px; font-weight: 900; line-height: 1.35; }
.ts-dl dd small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-2); line-height: 1.45; }
.work-head .ts-calc p.ts-cmp-h { margin: 12px 0 4px; font-size: 14px; font-weight: 800; }
.ts-cmp { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ts-cmp li { border: 1.5px solid var(--line); border-radius: 10px; padding: 4px; text-align: center; font-size: 13px; line-height: 1.4; }
.ts-cmp li b { display: block; font-size: 13px; }
.ts-cmp li span { font: 800 16px var(--num); font-variant-numeric: tabular-nums; }
.ts-cmp li.on { border-color: var(--sky); background: var(--sky-soft); box-shadow: inset 0 0 0 1px var(--sky); }
.work-head .ts-calc p.ts-until { margin: 12px 0 0; padding: 8px 12px; background: var(--sky-soft); border-radius: 10px; font-size: 15px; line-height: 1.6; }
.ts-until b { font-size: 18px; }
.ts-over { color: var(--red); font-weight: 800; }
.work-head .ts-calc p.ts-foot { margin: 12px 0; font-size: 12.5px; line-height: 1.6; }
.work-head h3.ts-next { margin: 8px 0 6px; }
@media (max-width: 380px) { .ts-big b { font-size: 30px; } }
@media (min-width: 1024px) { .ts-calc { padding: 20px 24px; } .ts-grid { grid-template-columns: repeat(4, 1fr); } .ts-dl { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 道具に足す部分（ほかの設定の中）---------- */
.ts-hint { margin: 8px 0 0; padding: 8px 12px; background: var(--sky-soft); border-radius: 10px; }
.ts-hint[hidden] { display: none; }

/* ---------- 本文の表（スマホ358pxに収める）---------- */
.ts-tbl td, .ts-tbl th { font-size: 14px; }
.ts-tbl .num { white-space: nowrap; }
.ts-tbl td.t { white-space: normal; line-height: 1.3; font-size: 13px; }
.ts-rev td, .ts-rev th { font-size: 13px; padding-left: 4px; padding-right: 4px; }
.ts-rk th[scope=row], .ts-gk th[scope=row] { font-size: 14px; line-height: 1.4; }
.ts-rk .num, .ts-gk .num { width: 1%; }
.ts-gk td, .ts-gk thead th { font-size: 13px; padding-left: 4px; padding-right: 4px; }

@media print { html body.seo .ts-calc { display: none !important; } }
