/* =========================================================
   デザインあるある集
   見本の邪魔をしない、控えめな見た目にまとめる
   ========================================================= */

/* ---------- 色・寸法の変数 ---------- */
:root {
  --bg: #fafaf8;             /* ページの背景 */
  --surface: #ffffff;        /* カードの背景 */
  --surface-sub: #f3f3ef;    /* 見本やコード欄の背景 */
  --text: #2a2a28;           /* 本文の文字色（純黒は避ける） */
  --text-sub: #5c5c57;       /* 補足の文字色（白背景でコントラスト比 約6.6） */
  --line: #e4e3dd;           /* 1px の区切り線 */
  --accent: #2d5b86;         /* リンク・グラフ・ラベルの色（白背景で約6.9） */
  --accent-soft: #e6eef6;    /* アクセントの薄い背景 */
  --disabled: #6e6e68;       /* 準備中タブの文字色 */
  --code-bg: #2b2b29;        /* コード欄の背景 */
  --code-text: #f1f1ec;      /* コード欄の文字色 */
  --focus: #1f6fd1;          /* フォーカス枠の色 */

  --radius: 10px;            /* カードの角丸 */
  --radius-sm: 6px;          /* 内側の小さな部品の角丸 */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);

  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --cat-nav-h: 52px;         /* 固定されるカテゴリリンクの高さ */
  --ui-speed: 200ms;         /* まとめサイト自体の動きの速さ */
}

/* ---------- 基本 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* 動きを減らす設定でないときだけ、ページ内リンクをなめらかに移動させる */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
}

@media (min-width: 768px) {
  body {
    font-size: 16px;
  }
}

h1, h2, h3, p, ul, dl, dd, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere; /* 長いURLで横にはみ出さないようにする */
}

/* フォーカス表示は消さず、見やすい枠を付ける */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

/* 画面には出さず、読み上げだけに使う文字 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }
}

/* ---------- ヘッダー ---------- */
.site-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* トーン切替タブ。幅が足りないときはタブの列だけ横にスクロールする */
.tone-tabs {
  margin-top: 12px;
}

.tone-tabs__list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px; /* フォーカス枠が切れないよう少し余白を取る */
  scrollbar-width: thin;
}

@media (min-width: 1024px) {
  .tone-tabs__list {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.tone-tab {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap; /* 狭い画面でも文字を縦に折り返さない */
  cursor: pointer;
  transition: background-color var(--ui-speed) ease-out, border-color var(--ui-speed) ease-out;
}

.tone-tab:hover:not(:disabled) {
  border-color: var(--accent);
}

/* 選択中のタブ */
.tone-tab[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* 準備中のタブ（押せない） */
.tone-tab:disabled {
  background: var(--surface-sub);
  border-style: dashed;
  color: var(--disabled);
  cursor: not-allowed;
}

.tone-tab__note {
  font-size: 11px;
}

/* ---------- トーン概要 ---------- */
.overview {
  padding-top: 32px;
  padding-bottom: 24px;
}

.overview__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
}

.overview__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px 24px;
  margin-top: 16px;
  font-size: 14px;
}

.overview__facts dt {
  color: var(--text-sub);
  font-size: 12px;
}

.overview__facts dd {
  font-weight: 500;
}

/* データが1件も無いとき */
.empty {
  padding: 48px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty p + p {
  margin-top: 4px;
  color: var(--text-sub);
  font-size: 14px;
}

/* ---------- カテゴリリンク（上部に固定） ---------- */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 248, 0.94);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cat-nav__list {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  min-height: var(--cat-nav-h);
  align-items: center;
}

.cat-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--ui-speed) ease-out;
}

.cat-nav__list a:hover {
  background: var(--accent-soft);
}

/* 選ばれているタブ。色と下線で分かるようにする */
.cat-nav__list a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* hidden を付けた要素は、表示指定があっても必ず隠す */
[hidden] {
  display: none !important;
}

/* ---------- カテゴリのセクション ---------- */
.category {
  padding-top: 40px;
  /* 固定されたカテゴリリンクに見出しが隠れないようにする */
  scroll-margin-top: calc(var(--cat-nav-h) + 8px);
}

.category__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.category__lead {
  margin-top: 8px;
  color: var(--text-sub);
}

/* フォントのカテゴリの注記 */
.category__note {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.7;
}

/* group（ヘッダー／ボタンなど）へのページ内リンク */
.group-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.group-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--surface);
  font-size: 14px;
  text-decoration: none;
  transition: border-color var(--ui-speed) ease-out;
}

.group-nav a:hover {
  border-color: var(--accent);
}

/* group の小見出し。固定タブに隠れないよう、上に余白を取って止まる */
.group {
  margin-top: 40px;
}

.group__title {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  scroll-margin-top: calc(var(--cat-nav-h) + 16px);
}

.group .card-grid {
  margin-top: 16px;
}

/* カードの並び。スマホは1列、広い画面では2列 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* ---------- 項目カード ---------- */
.card {
  --pad: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0; /* 中のコード欄が横に広がりすぎないようにする */
  padding: var(--pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* 「あるある」「こういう手もある」のラベル */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.badge--aruaru {
  background: var(--accent);
  color: #fff;
}

.badge--alt {
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

/* 出現率 */
.rate__text {
  font-size: 14px;
}

.rate__text strong {
  font-size: 16px;
}

.rate__bar {
  height: 8px;
  margin-top: 4px;
  border-radius: 9999px;
  background: var(--surface-sub);
  overflow: hidden;
}

.rate__fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--accent);
}

/* 最小・中央値・最大 */
.range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range__item {
  flex: 1 1 0;
  min-width: 80px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-sub);
  text-align: center;
}

.range__item dt {
  color: var(--text-sub);
  font-size: 12px;
}

.range__item dd {
  font-weight: 700;
}

.card__detail {
  font-size: 15px;
}

/* 小見出し（見本・コード・根拠サイト） */
.card__label {
  margin-bottom: 6px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- 見本の共通枠 ---------- */
.sample {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface);
  overflow: hidden;
}

.sample__note {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 12px;
}

/* 文章見本（文字の見た目はデータの css をそのまま当てる） */
.sample--text p {
  overflow-wrap: anywhere;
}

/* 色見本 */
.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.swatch {
  width: 88px;
}

.swatch__chip {
  height: 56px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
}

.swatch__hex {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
}

.swatch__label {
  font-size: 12px;
  line-height: 1.5;
}

/* 背景色の上に置いた色見本は、文字の読みやすさのため白い帯を敷く */
.sample--palette.has-bg .swatch__text {
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.sample--palette.has-bg .swatch__hex {
  margin-top: 0;
}

/* 余白見本。値を縦のバーで実寸表示する */
.spacing {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.spacing__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  text-align: center;
}

.spacing__value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.spacing__bar {
  width: 40px;
  min-height: 1px;
  margin-top: 4px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent-soft) 0 6px,
    #cddcea 6px 12px
  );
  border: 1px solid var(--accent);
}

.spacing__label {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

/* 動きの見本 */
.motion__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-sub);
  overflow: hidden;
}

/* 表示アニメーションの対象になる箱 */
.motion__target {
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
}

/* 再生前の状態（effect ごと） */
.motion__target.is-from[data-effect="fade-up"] {
  opacity: 0;
  transform: translateY(24px);
}

.motion__target.is-from[data-effect="fade"] {
  opacity: 0;
}

.motion__target.is-from[data-effect="slide"] {
  opacity: 0;
  transform: translateX(-40px);
}

/* ホバーで確認するリンク見本。速さと変化のしかたは変数で受け取る */
.motion__link {
  position: relative;
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
}

.motion__link[data-effect="hover-opacity"] {
  transition: opacity var(--d) var(--e);
}

.motion__link[data-effect="hover-opacity"]:hover,
.motion__link[data-effect="hover-opacity"]:focus-visible,
.motion__link[data-effect="hover-opacity"].is-hover {
  opacity: 0.5;
}

/* 下線が左から伸びる見本 */
.motion__link[data-effect="hover-underline"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--d) var(--e);
}

.motion__link[data-effect="hover-underline"]:hover::after,
.motion__link[data-effect="hover-underline"]:focus-visible::after,
.motion__link[data-effect="hover-underline"].is-hover::after {
  transform: scaleX(1);
}

.motion__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}

.motion__spec {
  flex: 1 1 200px;
  color: var(--text-sub);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ---------- 見本 (1) fonts: 実際のフォントで並べる ---------- */
.fonts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fonts__row + .fonts__row {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* 上段: フォント名・サイト名・割合・バッジ */
.fonts__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.fonts__family {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.fonts__site,
.fonts__share {
  color: var(--text-sub);
}

/* 下段: 見本の文章（背景はサイトの本文の背景） */
.fonts__view {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.fonts__text {
  overflow-wrap: anywhere;
}

.fonts__spec {
  margin-top: 6px;
  color: var(--text-sub);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* 表示状態のバッジ */
.font-badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.font-badge.is-checking {
  border-color: var(--line);
  color: var(--text-sub);
}

.font-badge.is-real {
  background: #e3f1e4;
  color: #1f5a2a; /* 背景に対してコントラスト比 約7 */
}

.font-badge.is-fallback {
  background: #fbeedd;
  color: #7a4200; /* 背景に対してコントラスト比 約7 */
}

/* ---------- 見本 (2) palette-groups: サイトごとの色の組 ---------- */
.pgroups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 1行 = 1サイト。左にサイト名、右に色見本 */
.pgroups__row {
  display: grid;
  /* 狭い画面ではサイト名の列を細くして、色見本を1行に3つ以上並べる */
  grid-template-columns: minmax(0, 84px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .pgroups__row {
    grid-template-columns: minmax(72px, 140px) minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
}

.pgroups__label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pgroups__colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pgroups__color {
  width: 52px;
}

/* 色見本には濃いめの枠を付け、白い色も見えるようにする */
.pgroups__chip {
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}

.pgroups__color .swatch__hex {
  font-size: 11px;
}

/* ---------- 見本 (3) colorpairs: 背景色と文字色の組み合わせ ---------- */
.cpairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 16px;
}

.cpairs__card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.cpairs__small {
  font-size: 16px;
  line-height: 1.6;
}

.cpairs__large {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.4;
}

.cpairs__label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.cpairs__values {
  color: var(--text-sub);
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- 見本 (4) boxmodel: 開発者ツールの余白図 ---------- */
/* 色は Chrome の開発者ツールに合わせる */
.sample--boxmodel {
  margin: 0;
}

.bm {
  color: #222;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

/* 1つの層。上・左右・下に数値、中央に内側の層を置く */
.bm__layer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(32px, auto) minmax(0, 1fr) minmax(32px, auto);
  grid-template-areas:
    ". top ."
    "left inner right"
    ". bottom .";
  align-items: center;
  padding: 4px;
  border: 1px dashed #555;
}

.bm--margin { background: #f9cc9d; }
.bm--border { background: #fddd9b; }
.bm--padding { background: #c3d08b; }

/* 層の名前は左上に置く */
.bm__name {
  position: absolute;
  top: 3px;
  left: 6px;
  max-width: 45%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm__v {
  padding: 2px 4px;
  text-align: center;
}

.bm__top {
  grid-area: top;
  padding-top: 18px; /* 左上の名前と重ならないよう、上に少し余白を取る */
}

.bm__left { grid-area: left; }
.bm__right { grid-area: right; }
.bm__bottom { grid-area: bottom; }
.bm__inner { grid-area: inner; min-width: 0; }

/* 一番内側の中身は実線で囲む */
.bm__content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px;
  border: 1px solid #555;
  background: #8cb6c0;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ---------- 見本 (5) stack: 余白を実寸で縦に積む ---------- */
.stack {
  display: grid;
  gap: 12px;
  align-items: start;
}

.stack__col {
  min-width: 0;
}

.stack__label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* コンテンツ（青）と余白（オレンジ）。色は boxmodel と同じ */
.stack__block,
.stack__gap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.stack__block {
  height: 32px;
  border: 1px solid #555;
  background: #8cb6c0;
}

.stack__gap {
  border-right: 1px dashed #555;
  border-left: 1px dashed #555;
  background: #f9cc9d;
  font-family: var(--mono);
  font-weight: 700;
}

/* ---------- 見本 (6) counts: サイト数の横棒グラフ ---------- */
.counts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.counts__row {
  display: grid;
  grid-template-columns: minmax(64px, 7em) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.counts__label {
  overflow-wrap: anywhere;
}

.counts__bar {
  height: 10px;
  border-radius: 9999px;
  background: var(--surface-sub);
  overflow: hidden;
}

.counts__fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--accent);
}

.counts__num {
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- 見本 (7) lenis: 慣性スクロールの体験 ---------- */
/* 広いときは横に2つ、狭いときは縦に並べる */
.scroll-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
}

.scroll-demo__label {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
}

.scroll-demo__frame {
  height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain; /* 枠の端まで来てもページごと動かないようにする */
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sub);
}

.scroll-demo__content {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
}

.scroll-demo__content p + p {
  margin-top: 12px;
}

/* =========================================================
   UI部品の見本
   ========================================================= */

/* 見本の下に出す、サイト名や寸法の行 */
.ui-caption {
  margin-top: 6px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* 3本線のアイコン（線の太さは --line で受け取る） */
.burger-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(var(--line, 1px) * 3 + 12px);
  flex-shrink: 0;
}

.burger-icon > span {
  display: block;
  height: var(--line, 1px);
  background: currentColor;
}

/* ---------- (1) ui-header ---------- */
.uih {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.uih__stage {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

/* 透明なヘッダー: 写真代わりのグラデーションの上に重なり、下にも写真が続く */
.uih__stage.is-clear {
  padding-bottom: 24px;
  background: linear-gradient(135deg, #6b6b66 0%, #4a4a46 55%, #3a3a37 100%);
  color: #fff;
}

.uih__stage.is-clear .uih__bar {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.7); /* ヘッダーの範囲の目印 */
}

.uih__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  overflow: hidden;
}

.uih__bar.has-shadow {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.uih__logo {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  border: 1px solid currentColor;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
}

.uih__logo span {
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ロゴが中央のときは、行の真ん中に置く */
.uih__logo.is-center {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -50%);
}

.uih__nav,
.uih__spacer {
  flex: 1 1 0;
  min-width: 0;
}

.uih__nav {
  overflow: hidden;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uih__nav.is-end { text-align: right; }
.uih__nav.is-start { text-align: left; }

.uih__nav span + span {
  margin-left: 1.4em;
}

.uih__burger {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.uih__burger-label {
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- (2) ui-sticky ---------- */
.uis__frame {
  height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* 透明なヘッダーを上部に固定する */
.uis__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  color: #222;
}

.uis__logo {
  padding: 2px 10px;
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 700;
}

.uis__nav {
  display: flex;
  gap: 14px;
  font-size: 12px;
}

/* 写真代わりの明るいグラデーション（ヘッダーの濃い文字が読めるように明るめ） */
.uis__photo {
  display: flex;
  align-items: flex-end;
  height: 220px;
  padding: 12px 16px;
  background: linear-gradient(160deg, #e2e2dc 0%, #c9c9c1 100%);
  color: #444;
  font-size: 12px;
}

.uis__body {
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
}

.uis__body p + p {
  margin-top: 12px;
}

/* ---------- (3) ui-burgers ---------- */
.uib {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 12px;
}

.uib__item {
  flex: 1 1 120px;
  max-width: 100%;
  min-width: 0;
}

/* 1マス。白っぽい背景の中央に実寸のボタンを置く */
.uib__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 104px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-sub);
  overflow-x: auto;
}

/* 線が白に近いときは、濃い灰色の写真風の背景にする */
.uib__stage.is-dark {
  background: linear-gradient(135deg, #6b6b66 0%, #4a4a46 55%, #3a3a37 100%);
}

.uib__btn {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  outline: 1px dashed rgba(120, 120, 120, 0.8); /* ボタンの範囲の目印（寸法には含まれない） */
}

/* 線は上端からの位置で置き、横は中央にそろえる */
.uib__lines {
  position: relative;
  flex: 0 0 auto;
}

.uib__lines > span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.uib__label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
}

/* ---------- (4) ui-phone ---------- */
.uip {
  display: grid;
  grid-template-columns: repeat(auto-fill, 190px); /* 枠 187.5px ＋ 線 1px×2 が収まる幅 */
  gap: 20px 16px;
}

/* 375×812 を 0.5倍にした枠。線の内側がちょうど 187.5×406 になるよう、線は外側に付ける */
.uip__frame {
  position: relative;
  box-sizing: content-box;
  width: 187.5px;
  height: 406px;
  border: 1px solid #b9b9b3;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.uip__screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 375px;
  height: 812px;
  transform: scale(0.5);
  transform-origin: 0 0;
  color: #222;
}

.uip__logo,
.uip__burger,
.uip__panel {
  position: absolute;
}

.uip__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #777;
  background: #eeeee9;
  font-size: 20px;
  overflow: hidden;
}

.uip__burger {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #555;
}

.uip__links {
  padding: 96px 32px 0;
  line-height: 1.6;
}

.uip__links li + li {
  margin-top: 1em;
}

/* ---------- (5) ui-buttons ---------- */
.uibt {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 見本の背景は薄い灰色（白いボタンも見えるように）。広いボタンはこの中だけ横にスクロール */
.uibt__stage {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: #f0f0ec;
  overflow-x: auto;
}

/* 塗りが無く白い文字のボタンは、濃い灰色の下地にのせる（仮の色） */
.uibt__stage.is-dark {
  background: #4a4a4a;
}

.uibt__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  flex: 0 0 auto;
  line-height: 1.2;
  white-space: nowrap;
}

.uibt__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- (6) ui-footer ---------- */
.uif {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.uif__band {
  position: relative;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

/* 背景色が測れていないときの斜線 */
.uif__band.is-unknown {
  background: repeating-linear-gradient(-45deg, #f3f3ef 0 8px, #e2e2dc 8px 9px);
}

/* 白いコピーライトが読めるよう、斜線模様を濃い色にする（仮の色） */
.uif__band.is-unknown.is-dark {
  background: repeating-linear-gradient(-45deg, #4a4a4a 0 8px, #5c5c5c 8px 9px);
}

.uif__unknown {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-sub);
  font-size: 11px;
}

.uif__sns {
  position: absolute;
  top: 12px;
  left: 16px;
  display: flex;
  gap: 6px;
}

.uif__sns li {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.uif__copy {
  position: absolute;
  right: 16px;
  bottom: 8px;
  left: 16px;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- ボタン共通 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--ui-speed) ease-out;
}

.btn:hover {
  background: var(--accent-soft);
}

/* ---------- コピペ用コード ---------- */
.code {
  border-radius: calc(var(--radius) - 4px);
  background: var(--code-bg);
  color: var(--code-text);
  overflow: hidden;
}

.code__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 4px 0;
}

.code__status {
  color: #c9e4c5;
  font-size: 13px;
}

.code .btn {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--code-text);
  /* 見た目は小さめでも、押せる範囲は外側の余白で確保する */
  position: relative;
}

.code .btn::before {
  content: "";
  position: absolute;
  inset: -4px;
}

.code .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.code pre {
  margin: 0;
  padding: 8px 16px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------- 根拠サイト ---------- */
.evidence__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
}

.evidence__list a {
  display: inline-block;
  padding: 6px 0; /* タップしやすいよう上下に余白を取る */
}

/* ---------- サイト別の実測値一覧表 ---------- */
.sites-section {
  padding-top: 56px;
  padding-bottom: 56px;
  scroll-margin-top: calc(var(--cat-nav-h) + 8px);
}

.sites-section h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.sites-section__lead {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 14px;
}

/* 表だけ横スクロールできる枠 */
.table-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.6;
}

.metrics-table th,
.metrics-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.metrics-table thead th {
  background: var(--surface-sub);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}

.metrics-table tbody tr:last-child th,
.metrics-table tbody tr:last-child td {
  border-bottom: 0;
}

/* サイト名の列は横スクロールしても左に残す */
.metrics-table tbody th {
  position: sticky;
  left: 0;
  background: var(--surface);
  font-weight: 500;
  box-shadow: 1px 0 0 var(--line);
}

.metrics-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}

/* 長いイージングやライブラリ名は折り返す */
.metrics-table td.is-wrap {
  min-width: 180px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 表の中の小さな色見本 */
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  vertical-align: -1px;
}

/* ---------- フッター ---------- */
.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 13px;
}

/* ---------- 動きを減らす設定のとき ---------- */
/* まとめサイト自体の動きは止める（見本の動きはボタンで再生できるよう残す） */
@media (prefers-reduced-motion: reduce) {
  .tone-tab,
  .cat-nav__list a,
  .btn {
    transition: none;
  }
}
