/* =========================================================
   うけつけ 部品カタログ（style.css の上に重ねる見本帳の組版）
   正本：system/DESIGN.md 8章（状態）・11章（部品）。
   状態はクラスで再現する（is-hover / is-focus / is-pressed）。見本の枠も本体と同じく：
   影なし、角丸 4 / 8 / 12、罫 1px、色はトークンだけ。
   ========================================================= */

.ct-intro { padding: 64px 0 48px; }
.ct-intro h1 { margin-top: 12px; }
.ct-intro .ct-lead { margin-top: 16px; max-width: 46em; }
.ct-note { margin-top: 16px; max-width: 46em; padding-left: 16px; border-left: 1px solid var(--line); }
.ct-toc { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.ct-toc ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; list-style: none; counter-reset: toc; }
.ct-toc li { counter-increment: toc; display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); }
.ct-toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); color: var(--ink-2); }
.ct-toc a { display: inline-flex; align-items: center; min-height: 36px; }
@media (max-width: 1023px) { .ct-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 見本を置く台（白の面・罫 1px・角丸 12） */
.ct-stage { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ct-stage + .ct-stage, .ct-stage + .uk-sub, .ct-grid + .uk-sub { margin-top: 24px; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 32px 24px; }
.ct-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.ct-cell { min-width: 0; }
.ct-cell > .uk-field:first-child, .ct-cell > .ct-state + .uk-field { margin-top: 0; }
.ct-state { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: var(--fs-small); line-height: 1.6; letter-spacing: .04em; color: var(--ink-2); }
.ct-state b { font-family: var(--font-sans); font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.ct-memo { margin-top: 12px; font-size: var(--fs-small); line-height: 1.6; color: var(--ink-2); }
.ct-none { display: flex; align-items: center; min-height: var(--control-h); margin-top: 8px; color: var(--ink-3); }
.ct-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* 疑似の状態（見本だけ）。値は style.css の :hover / :focus-visible / :active と同じ */
.uk-input.is-hover, .uk-select.is-hover, .uk-textarea.is-hover { border-color: var(--ink-2); }
.uk-input.is-focus, .uk-select.is-focus, .uk-textarea.is-focus { border-color: var(--accent); outline: var(--focus-ring); outline-offset: 2px; }
.uk-btn.is-focus, .uk-textbtn.is-focus, a.is-focus, .uk-choice input.is-focus { outline: var(--focus-ring); outline-offset: 2px; }
.uk-btn--primary.is-hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.uk-btn--primary.is-pressed { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.uk-btn--secondary.is-hover { background: var(--hover); }
.uk-tiles .uk-choice.is-hover { background: var(--hover); }
.uk-choice input.is-hover { border-color: var(--ink-2); }

/* ステップ表示：幅に関係なく、640px 未満の形も並べて見せる */
.ct-steps-compact .uk-steps ol { display: none; }
.ct-steps-compact .uk-steps__compact { display: block; }
.ct-steps .uk-steps { margin: 0; }

/* ファイル（11.7）：フォームのサンプルでは使っていないので、部品の CSS をここに置く */
.uk-file { margin-top: 8px; padding: 24px; background: var(--surface); border: 1px solid var(--line-control); border-radius: var(--radius-md);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
.uk-file.is-error { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.uk-file.is-disabled { background: var(--disabled-bg); border-color: var(--line); color: var(--ink-3); }
.uk-file__drop { font-size: var(--fs-small); line-height: 1.6; color: var(--ink-2); }
.uk-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.uk-file-list { margin-top: 8px; list-style: none; border-top: 1px solid var(--line); }
.uk-file-list li { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--line); }
.uk-file-list .uk-file-list__name { min-width: 0; overflow-wrap: anywhere; }
.uk-file-list .uk-file-list__size { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-small); color: var(--ink-2); white-space: nowrap; }
.uk-file-list .uk-file-list__busy { font-size: var(--fs-small); color: var(--ink-2); white-space: nowrap; }
.uk-file-list .uk-textbtn { flex: none; }

/* 色見本 */
.ct-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.ct-sw { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ct-sw__chip { height: 64px; background: var(--c); border-bottom: 1px solid var(--line); }
.ct-sw__body { padding: 8px 12px 12px; }
.ct-sw__name { font-weight: 700; }
.ct-sw__meta { font-family: var(--font-mono); font-size: var(--fs-small); line-height: 1.6; letter-spacing: 0; color: var(--ink-2); }

/* 書体の見本 */
.ct-type { border-top: 1px solid var(--line); }
.ct-type > div { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ct-type .ct-memo { margin: 0; }
@media (max-width: 767px) { .ct-type > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* 状態の表（8.2） */
.ct-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ct-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: var(--fs-small); line-height: 1.6; }
.ct-table th, .ct-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ct-table tr:last-child th, .ct-table tr:last-child td { border-bottom: 0; }
.ct-table thead th { color: var(--ink-2); font-weight: 400; }
.ct-table tbody th { font-weight: 700; white-space: nowrap; }
.ct-dash { color: var(--ink-3); }

/* アイコンと形 */
.ct-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.ct-icons > div { display: flex; align-items: center; gap: 12px; }
.ct-shape { display: grid; place-items: center; height: 88px; background: var(--bg); border: 1px solid var(--line-control);
  font-family: var(--font-mono); font-size: var(--fs-small); color: var(--ink-2); }

/* 完了画面・確認画面の見本は、用紙の中に置く */
.ct-paper { padding: var(--sheet-pad); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ct-paper > .uk-review:first-child, .ct-paper > .uk-receipt:first-child, .ct-paper > .uk-summary:first-child, .ct-paper > .uk-resume:first-child { margin-top: 0; }
@media (max-width: 639px) { .ct-paper { padding: 16px; } .ct-stage { padding: 16px; } }

/* 密度の見本：用紙の幅を狭めず、詰めはここでも 1024px 以上だけ効く */
.ct-density { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
@media (max-width: 1023px) { .ct-density { grid-template-columns: minmax(0, 1fr); } }
.ct-density .uk-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sheet-pad); }
.ct-density .uk-sheet > .uk-field:first-of-type { margin-top: 16px; }

/* 640px 未満でも、カタログでは 640px 以上の形の見本を横スクロールで見せる（フォームのページでは隠れる） */
@media (max-width: 639px) {
  .ct-steps .ct-cell:not(.ct-steps-compact) .uk-steps ol { display: flex; overflow-x: auto; padding: 4px 2px; }
}
