@charset "UTF-8";
/* =========================================================================
 * base.css  —  造形トレーニング 共通デザインシステム
 *
 * このファイルがサイト全体の見た目の定義元。
 * 新しいコンテンツを足すときは、まずこれを読み込んでから
 * そのコンテンツ固有のCSSを書く。共通部品をコンテンツ側で
 * 上書きし始めたら、それは base.css に足すべきものかを先に疑う。
 *
 * 配色の方針:
 *   UIには色みを持たせない。色を見分ける課題を扱うサイトなので、
 *   周囲に色があると色の見えがそちらに引きずられる。
 *   下地・文字・線はすべて R=G=B のニュートラルグレー（2026-10-29 にベージュ寄りから変更）。
 *   同じ理由でダークモードは用意せず、明るいグレーで固定する。
 *   彩度のある色は、警告など本当に必要な印にだけ使う（--accent・--warn・--danger）。
 *
 * デザインの基準はカラートーン（トーン合わせトレーニング）の画面。
 * ほかの画面を揃えるときは、そちらに合わせる（中央寄せのヘッダー・ヘルプのモーダルなど）。
 * ========================================================================= */

/* ---- トークン ------------------------------------------------------- */
:root {
  --bg:            #fafafa;
  --surface:       #ffffff;
  --surface-2:     #f5f5f5;
  --surface-3:     #e2e2e2;
  --ink:           #222222;
  --ink-2:         #535353;
  --muted:         #666666;   /* 補助の文字。本文の下地・ヘッダーの下地・白のどれに載っても 4.5:1 以上 */
  --line:          #cbcbcb;   /* 2026-10-29 に気持ち濃く（#d6d6d6 から）。くっきりさせすぎるとプレイの邪魔になる */
  --line-strong:   #a9a9a9;   /* 同上（#b8b8b8 から）。ボタンの枠など */
  --focus:         #222222;   /* フォーカスの輪も無彩色。太さで見せる */
  --accent:        #e3001b;   /* 印だけに使う赤。面には使わない */
  --warn:          #a8611b;
  --warn-bg:       #fbf3e6;   /* --warn のお知らせの下地 */
  --warn-line:     #e2c99a;   /* --warn のお知らせの枠 */
  --danger:        #8d2d22;   /* 失敗を知らせる通知の下地 */
  --ink-hover:     #3a3a3a;   /* --ink の面に乗ったときの色 */
  --on-dark:       #ffffff;   /* --ink など濃い面に載せる文字 */
  --header-bg:     rgba(235, 235, 235, .92);   /* 背景が透ける上部バー。本文の下地より一段暗い */
  --backdrop:      rgba(0, 0, 0, .45);         /* モーダルの後ろを暗くする幕 */
  --seg-off-bg:    #767676;   /* 切り替え（.segmented）の選ばれていない側の下地。白い文字で 4.5:1 */
  --seg-off-ink:   #ffffff;   /* 同じく文字 */
  --seg-off-hover: #686868;   /* 同じく、マウスを載せたときの下地（少し濃く） */
  /* 色見本に接する線は無彩色にする。枠にわずかでも色みがあると、
     隣り合う色面の見えがそちらに引きずられるため。 */
  --art-edge:      #c9c9c9;

  --radius:        10px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, .07), 0 2px 8px rgba(0, 0, 0, .05);
  --shadow-md:     0 2px 6px rgba(0, 0, 0, .09), 0 12px 32px rgba(0, 0, 0, .10);

  --header-h:      60px;
  --tabs-h:        0px;     /* ヘッダーの下の帯（.site-tabs）の高さ。帯のあるページだけ値を入れる（8分割法の style.css） */
  /* 上に貼り付く部品（色パネル・ギャラリーの自分の作品）は、ヘッダーと帯の下に置く */
  --sticky-top:    calc(var(--header-h) + var(--tabs-h));
  --maxw:          1180px;

  color-scheme: light;
}

/* ---- リセット ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* ページ内リンク（#about など）で飛んだとき、見出しが貼り付いたヘッダーの下に隠れないように */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--sticky-top); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
               "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
/* 出し入れは el.hidden で行う。display の値を JS 側で覚えておかなくて済む。 */
[hidden] { display: none !important; }
img, canvas, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--on-dark); padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* =========================================================================
 * ヘッダー / フッター
 * ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h);
  padding: 0 20px;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a {
  display: block; padding: 7px 14px;
  font-size: 14px; text-decoration: none; color: var(--ink-2);
  border-radius: 999px;
}
.site-nav a:hover { background: var(--surface-3); color: var(--ink); }

/* コンテンツ側のヘッダーに置く「一覧へ戻る」導線。
   各コンテンツはサイトの中の1ページなので、必ず親へ戻れるようにする。 */
.site-nav .nav-up {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted);
}
.site-nav .nav-up::before {
  content: ""; width: 6px; height: 6px; flex: none;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* 中央寄せのヘッダー。左端に「一覧へ戻る」、中央にタイトル、右端にヘルプなどの操作。
   左右の列を同じ幅（1fr）にして、タイトルが画面のまん中に来るようにする。 */
.site-header--center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
}
.site-header--center .site-nav { margin-left: 0; justify-self: start; }
/* 列は名前で決める（左の「一覧へ戻る」が無いページ＝一覧ページでも、タイトルを中央の列に置くため） */
.site-header__title {
  grid-column: 2;
  font-size: 17px; font-weight: 700; letter-spacing: .06em;
  text-align: center; white-space: nowrap;
}
.site-header__actions { grid-column: 3; justify-self: end; display: flex; gap: 6px; align-items: center; }

/* ヘッダーの下の帯に置く、画面の切り替え（8分割法の「はじめに／つくる／ギャラリー」など）。
   ヘッダーと一緒に上に貼り付く。現在地は下線と濃い文字で示す（app.js が is-active と aria-current を付ける） */
.site-tabs {
  position: sticky; top: var(--header-h); z-index: 39;
  height: var(--tabs-h);   /* 高さを決めておく（貼り付く部品が --sticky-top でこの下に並ぶため） */
  display: flex; justify-content: center; align-items: stretch; gap: 4px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-tabs a {
  display: flex; align-items: center;
  padding: 2px 16px 0;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.site-tabs a:hover { color: var(--ink); }
.site-tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* 丸いアイコンだけのボタン（ヘルプの「？」など）。名前は aria-label で付ける */
.icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 50%;
  font-size: 17px; font-weight: 700; line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--muted); }

/* 線で描くアイコン（× − ＋）。文字（×・−・＋）だと書体ごとに上下の余白が違い、
   ボタンの中央に置いても少しずれるため、線を2本（または1本）重ねて描く。大きさは --icon-size */
.icon-x, .icon-minus, .icon-plus { position: relative; }
.icon-x::before, .icon-x::after,
.icon-minus::before,
.icon-plus::before, .icon-plus::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: var(--icon-size, 12px); height: 2px; border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.icon-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.icon-x::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.icon-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.icon-btn.icon-x { --icon-size: 16px; }

.site-footer {
  padding: 34px 20px 44px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
.site-footer__meta { font-size: 12px; margin-top: 6px; }   /* 薄くしない（--muted でちょうど 4.5:1 を超える） */

/* =========================================================================
 * 汎用パーツ
 * ===================================================================== */
.view { min-height: 60vh; }
.view:focus, .view:focus-visible { outline: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.btn--primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }

.btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
/* 次へ進むボタン。右に、ヘッダーの「一覧へ戻る」（.nav-up）と同じ線の矢印を付ける */
.btn--next::after {
  content: ""; width: 6px; height: 6px; flex: none; margin-left: 2px;
  border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .06em; }

select, input[type="text"], input[type="search"] {
  min-height: 42px; padding: 0 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; font-size: 14px;
}
select { cursor: pointer; }

/* トグルスイッチ（チェックボックス） */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 38px; height: 22px; flex: none;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  border-radius: 999px; position: relative; transition: background .15s, border-color .15s;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--ink); border-color: var(--ink); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* セグメント切替（RGB / CMYK など）。選ばれている側は白地に濃い文字、選ばれていない側は灰色の地に白い文字。
   どちらが選ばれているかを、ひと目で分かるようにする（2026-10-29。以前は下地の差が 1.3:1 しかなかった） */
.segmented {
  display: flex; padding: 3px; gap: 3px;
  background: var(--seg-off-bg); border-radius: var(--radius);
}
.segmented button {
  flex: 1; min-height: 34px; padding: 0 10px;
  background: transparent; border: 0; border-radius: 7px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--seg-off-ink); cursor: pointer;
}
.segmented button:hover { background: var(--seg-off-hover); }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
/* 小さめの切り替え（課題の設定など、ボタンを並べる場所が狭いとき） */
.segmented--sm button { flex: none; min-height: 30px; font-size: 12px; white-space: nowrap; }
/* 暗い下地の上では濃いフォーカスの輪が見えないので、白にする */
.segmented button:focus-visible { outline-color: var(--surface); }

/* スライダー行（ラベル / つまみ / 数値）
   トラックの色は --track を各行で差し替えて使う。 */
/* ラベル｜−｜スライダー｜＋｜数値 */
.slider-row { display: grid; grid-template-columns: 20px 24px 1fr 24px 34px; gap: 6px; align-items: center; }
.slider-row label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
/* スライダーの両脇の「−」「＋」。1ずつ動かす */
.slider-step {
  --icon-size: 10px;   /* 中の − ＋ は線で描く（.icon-minus・.icon-plus） */
  width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink-2);
  font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;   /* 続けて押したときに拡大されないように */
}
.slider-step:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.slider-step:active { background: var(--surface-3); }
.slider-row output {
  font-size: 12px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; text-align: right;
}
.slider-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; background: transparent; cursor: pointer;
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: var(--track, var(--surface-3));
}
.slider-row input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 999px;
  background: var(--track, var(--surface-3));
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; margin-top: -5px;
  border-radius: 50%; background: #fff;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
}

/* トースト */
.toast-host {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--on-dark);
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
  max-width: min(360px, calc(100vw - 32px));
}
.toast.is-shown { opacity: 1; transform: none; }
.toast--error { background: var(--danger); }

/* =========================================================================
 * 文章まわり
 * ===================================================================== */
.hero { padding: 56px 0 40px; }
.hero__lead { font-size: 13px; letter-spacing: .18em; color: var(--muted); font-weight: 700; }
.hero h1 {
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.3; letter-spacing: .02em; margin: 10px 0 18px;
}
.hero p { max-width: 46em; color: var(--ink-2); }

.section { padding: 44px 0; }
.section__title {
  font-size: 20px; letter-spacing: .04em; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 10px;
}
.section__title span { font-size: 12px; color: var(--muted); letter-spacing: .1em; font-weight: 700; }
.section__desc { color: var(--ink-2); max-width: 48em; margin-bottom: 24px; }

/* =========================================================================
 * 色を作るパネル
 *
 * 8分割法トレーニングの制作画面で作った部品をここに上げたもの。
 * カラートーンでも同じ操作にするために共通化した。両コンテンツがこれを使う。
 * コンテンツ側で上書きしないこと。変えるならここを変えて、全テストを走らせる。
 * ===================================================================== */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: calc(var(--sticky-top) + 16px);
  max-height: calc(100vh - var(--sticky-top) - 32px);
  overflow-y: auto;
}
.panel__block { display: flex; flex-direction: column; gap: 10px; }
.panel__title {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
}

.wheel-row { display: flex; gap: 14px; align-items: center; }
.wheel-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.wheel-wrap canvas {
  width: 132px; height: 132px; border-radius: 50%;
  cursor: crosshair; touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.wheel-marker {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.4);
  pointer-events: none;
}

/* 現在の色。色の面を上、カラーコードを下の白い帯に縦に重ねる。
   カラーコードの入力欄はこの中の1か所だけ。

   枠は ::after で最前面に描く。overflow:hidden で子の背景を角丸に切り抜くと、
   切り抜きの縁と border の縁がそれぞれ別にアンチエイリアスされ、幅が端数に
   なる位置では角の円弧で両者がずれる。枠が太く見えたり掠れたりするのはこれ。 */
.swatch-current {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
}
.swatch-current::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: inherit;
  pointer-events: none;
}
.swatch-current__fill {
  flex: 1; min-height: 88px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.swatch-current__code {
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  padding: 6px 6px 7px;
}
/* 汎用の input[type="text"] は詳細度 0,1,1 で class 単独より強い。
   要素セレクタを足して確実に上書きしないと、枠線と高さが戻ってしまう。 */
.swatch-current input.swatch-current__hex {
  display: block;
  width: 100%; min-width: 0; min-height: 0; height: 24px; padding: 0 4px;
  background: transparent;
  border: 0; border-radius: 4px;
  color: var(--ink); text-align: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 15px; font-weight: 500; letter-spacing: .04em;
}
.swatch-current input.swatch-current__hex:hover { background: var(--surface-2); }
.swatch-current input.swatch-current__hex:focus {
  background: var(--surface-2); outline: 2px solid var(--focus); outline-offset: -1px;
}

.channel-box { display: flex; flex-direction: column; gap: 8px; }

/* R・G・B（または C・M・Y・K）のまとまりを包む器。
   「明」スライダーの下に置くときは --divided を付けて点線で分ける。
   明るさの調整と、インキ量／光量の指定は意味の違う操作なので、視線の切れ目をつくる。 */
.channels { display: flex; flex-direction: column; }
.channels--divided {
  padding-top: 12px;
  border-top: 1px dotted var(--line-strong);
}

/* 編集の操作。色の指定のすぐ下に置く */
.panel__tools {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.panel__tools .btn { width: 100%; gap: 6px; padding: 0 8px; }
.panel__tools .btn svg { width: 14px; height: 14px; flex: none; }

/* スポイト */
.btn--eyedrop { width: 100%; gap: 7px; }
.btn--eyedrop svg { width: 15px; height: 15px; flex: none; }
.btn--eyedrop.is-active {
  background: var(--ink); color: var(--on-dark); border-color: var(--ink);
}

/* 最近使った色。参考パレットは置かない。ここに並ぶのは自分が作った色だけ。 */
.swatches {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  max-width: 420px;
}
.swatches button {
  aspect-ratio: 1; border: 0; border-radius: 4px; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
}
.swatches button:hover { transform: scale(1.12); }
.swatches__empty { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: 0; }

/* =========================================================================
 * モーダル（<dialog class="modal">。ヘルプなど）
 * 開け閉めは dialog.showModal() / close()。Esc で閉じるのはブラウザの標準動作。
 * 指定は dialog.modal に限る。.modal という名前の div（以前の8分割法の自前の幕）に効いて、
 * 幕が左上 680px にしか掛からなくなったことがあるため（2026-10-29 のレビューで発見）。
 * ===================================================================== */
dialog.modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
dialog.modal::backdrop { background: var(--backdrop); }
dialog.modal .modal__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
dialog.modal .modal__title { font-size: 17px; letter-spacing: .04em; margin-right: auto; }
/* 開いたときに見出しへフォーカスを置く（tabindex="-1" autofocus）。見出しに枠は要らない */
dialog.modal .modal__title:focus { outline: none; }
dialog.modal .modal__body { padding: 18px 20px 22px; }
dialog.modal .modal__foot {
  gap: 10px;
  display: flex; justify-content: center;
  padding: 0 20px 20px;
}

/* お知らせのモーダル（ZT.util.phoneNotice など）。本文だけの短いもの */
dialog.modal--notice { width: min(440px, calc(100vw - 32px)); }
dialog.modal--notice .modal__body p { font-size: 14px; line-height: 1.8; color: var(--ink-2); }

/* バッジ（レベル・状態など） */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10.5px; letter-spacing: .08em; font-weight: 700;
  color: var(--muted); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.badge--warn  { color: var(--warn); border-color: var(--warn); }

/* =========================================================================
 * レスポンシブ
 * ===================================================================== */
/* 色を作るパネル。タブレット縦（iPad は 820〜834px）でもパネルを横に置いたままにする。
   下に回すと「対象を選ぶ → 色を作る」のたびにスクロールが要り、主動線が成立しない。
   パネルの外側の列幅は各トレーニングの CSS で決める。 */
@media (max-width: 900px) {
  .panel { padding: 14px; gap: 14px; }
  .wheel-wrap, .wheel-wrap canvas { width: 108px; height: 108px; }
  /* パネルが細いと色見本が潰れるので、ホイールの下に回す */
  .wheel-row { flex-wrap: wrap; }
  .swatch-current { flex: 1 1 100%; }
  .swatch-current__fill { min-height: 64px; }
  .slider-row { grid-template-columns: 16px 24px 1fr 24px 28px; gap: 5px; }
}

@media (max-width: 760px) {
  /* パネルを下に積むときは、中の各ブロックを横に並べて縦の伸びを抑える */
  .panel {
    position: static; max-height: none;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    align-items: start; gap: 18px 22px;
  }
  .wheel-row { justify-content: flex-start; }
  /* 指で押すので「−」「＋」を大きく */
  .slider-row { grid-template-columns: 18px 32px 1fr 32px 30px; gap: 6px; }
  .slider-step { width: 32px; height: 32px; --icon-size: 12px; }
}

@media (max-width: 640px) {
  .site-header { gap: 10px; padding: 0 14px; }
  .site-nav a { padding: 7px 10px; font-size: 13px; }
  .site-header--center { gap: 6px; }
  .site-header__title { font-size: 14.5px; letter-spacing: .02em; }
  .site-tabs { padding: 0 8px; }
  .site-tabs a { padding: 2px 10px 0; font-size: 13px; }
}

@media (max-width: 480px) {
  /* 狭い画面では「一覧へ戻る」を印だけにして、中央のタイトルの場所を空ける（文字は読み上げ用に残す） */
  .site-header--center .nav-up__text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  }
  .site-header--center .nav-up { padding: 10px 12px; }
  .wrap { padding: 0 14px; }
  .hero { padding: 34px 0 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-header, .site-tabs, .site-footer, .toast-host { display: none !important; }
  body { background: #fff; }
}
