/* ==========================================================================
   席次表作成ツール 専用CSS / Phase 1・ステップ1（会場情報＋自動保存の雛形）
   scm- プレフィックスで既存Bizroute CSSとの衝突を避ける。
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

/* Klee One / Yuji Syukuはローカルにwoff2があるためGoogle Fontsではなく
   @font-faceで読み込む。ブラウザは実際にそのfont-familyを使うテキストが
   描画されるまでファイルを取得しないため、ユーザーが選んだときだけ通信が
   発生する。いずれもOFLライセンス（Web埋め込み・商用利用可）。 */
@font-face {
  font-family: "Klee One";
  src: url("../fonts/KleeOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Yuji Syuku";
  src: url("../fonts/YujiSyuku-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: #f3f5f8;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Hiragino Kaku Gothic Pro', 'Yu Gothic', 'Meiryo', sans-serif;
  color: #1f2937;
  line-height: 1.6;
}

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid #2f6fb0;
  outline-offset: 2px;
}

@media (max-width: 991px) {
  body { padding-bottom: 72px; }
}

/* ── パンくず / SEOヘッダー ─────────────────────────────────────── */
.scm-breadcrumb {
  max-width: 1080px;
  margin: 14px auto 0;
  padding: 0 18px;
}

.scm-seo-header {
  max-width: 1080px;
  margin: 10px auto 14px;
  padding: 0 18px;
}

.scm-seo-header h1 {
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 8px;
}

.scm-seo-lead {
  max-width: 850px;
  color: #444;
  margin: 0 0 8px;
  line-height: 1.75;
}

.scm-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #64748b;
  font-size: 0.8rem;
}

.scm-feature-list li::before {
  content: "✓";
  margin-right: 5px;
  color: #2f6fb0;
  font-weight: 700;
}

/* ── Main Layout ─────────────────────────────────────────────────── */
.scm-main-container {
  max-width: 1080px;
  margin: 0 auto 48px;
  padding: 0 18px;
}

.scm-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.scm-col-input,
.scm-col-preview {
  min-width: 0;
}

/* PCでは「設定・入力」40〜45% / 「プレビュー」55〜60%の2カラムにし、
   プレビュー側はスクロールに追従させる(テーブル・参加者入力が増えても
   完成イメージを見ながら操作できるようにするため) */
@media (min-width: 992px) {
  .scm-main-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: 24px;
  }

  .scm-col-preview {
    position: sticky;
    top: 20px;
  }
}

/* 画面の高さが非常に低い環境(横向きタブレット等)では、stickyのプレビューが
   画面をはみ出して操作不能にならないよう、その場合だけ限定的にスクロールを許可する */
@media (min-width: 992px) and (max-height: 600px) {
  .scm-col-preview {
    max-height: 100vh;
    overflow-y: auto;
  }
}

/* ── ステップ案内 ─────────────────────────────────────────────── */
.scm-quick-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid #dbe7f3;
  border-radius: 9px;
  background: #f6f9fd;
  color: #315d8c;
}

.scm-quick-flow-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.scm-quick-flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.scm-quick-flow-steps span:not([aria-hidden="true"]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scm-quick-flow-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f6fb0;
  color: #fff;
  font-size: 0.74rem;
  line-height: 1;
}

.scm-sample-banner {
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid #f0dfb0;
  border-radius: 8px;
  background: #fdf7e8;
  color: #8a6a1e;
  font-size: 0.8rem;
  text-align: center;
}

/* ── Section Cards ─────────────────────────────────────────────── */
.scm-section-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e4e9f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.scm-setting-section {
  padding: 17px;
  margin-bottom: 14px;
  border: 1px solid #e5eaf0;
  border-radius: 10px;
  background: #fff;
}

.scm-setting-section:last-child { margin-bottom: 0; }

.scm-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.scm-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f4f8a;
  margin: 0;
}

.scm-section-description {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 0.79rem;
  line-height: 1.55;
}


/* ── 基本設定・会場情報の折りたたみ（PC・スマホ共通） ─────── */
.scm-mobile-collapsible .scm-collapsible-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.scm-section-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #2f6fb0;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.scm-section-toggle:hover {
  color: #1f4f8a;
}

.scm-mobile-collapsible.is-collapsed .scm-collapsible-heading {
  margin-bottom: 0;
}

.scm-mobile-collapsible.is-collapsed .scm-collapsible-body {
  display: none;
}

/* ── フォーム部品 ─────────────────────────────────────────────── */
.scm-form-field { margin-bottom: 14px; }
.scm-form-field:last-child { margin-bottom: 0; }

/* 基本設定(用紙・フォント・文字サイズ)は今後テーブル設定などが増えても
   縦に長くなりすぎないよう、詰めて配置する */
.scm-basic-settings .scm-form-field { margin-bottom: 10px; }
.scm-basic-settings .scm-form-field:last-child { margin-bottom: 0; }

/* 開催日・会場名は横幅に余裕がある画面では2列にする */
.scm-form-row-2col {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .scm-form-row-2col {
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
}

.scm-form-field label,
.scm-form-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.scm-field-help {
  margin: 0 0 6px;
  color: #8a939f;
  font-size: 0.72rem;
  line-height: 1.5;
}

/* 参加者数・テーブル数・空席数(入力中に確認したいのでテーブル一覧の上に置く) */
.scm-summary-status {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #e5eaf0;
  border-radius: 7px;
  background: #f6f8fa;
  color: #526579;
  font-size: 0.8rem;
}

.scm-summary-status b {
  color: #1f4f8a;
}

.scm-btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 4px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #2f6fb0;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.scm-btn-link:hover { color: #1f4f8a; }

.scm-optional {
  display: inline-block;
  margin-left: 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 400;
}

.scm-form-field input[type="text"],
.scm-form-field input[type="date"] {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 11px;
  min-height: 42px;
}

.scm-form-field input:focus {
  outline: none;
  border-color: #2f6fb0;
  box-shadow: 0 0 0 2px rgba(47, 111, 176, 0.18);
}

.scm-field-error {
  margin: 6px 0 0;
  color: #a83232;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
}

/* テーブルカード・座席カード内の小さめの入力欄 */
.scm-field label {
  display: block;
  margin-bottom: 3px;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
}

.scm-field input,
.scm-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 0.85rem;
}

.scm-field input:focus,
.scm-field select:focus {
  outline: none;
  border-color: #2f6fb0;
  box-shadow: 0 0 0 2px rgba(47, 111, 176, 0.18);
}

/* ── セグメントコントロール（用紙の向き・フォントなど） ───────────── */
.scm-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scm-segmented-option {
  position: relative;
}

.scm-segmented-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.scm-segmented-option span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.scm-segmented-option span:hover { background: #f4f7fb; }

.scm-segmented-option input:checked + span {
  background: #2f6fb0;
  border-color: #2f6fb0;
  color: #fff;
}

.scm-segmented-option input:focus-visible + span {
  outline: 2px solid #2f6fb0;
  outline-offset: 2px;
}

/* ── テーブル一覧 ─────────────────────────────────────────────── */
.scm-table-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.scm-table-list-empty {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #7a8491;
  font-size: 0.82rem;
  text-align: center;
}

.scm-table-card {
  padding: 12px;
  border: 1px solid #e4e9f0;
  border-radius: 9px;
  background: #fafbfc;
}

/* 折りたたみ時も常に見える概要行 */
.scm-table-card-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.scm-table-card-summary-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
  margin-right: auto;
}

.scm-table-card-summary-name {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
}

.scm-table-card-summary-meta {
  color: #64748b;
  font-size: 0.78rem;
}

.scm-table-card-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scm-table-move,
.scm-table-remove,
.scm-table-toggle {
  flex: none;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.scm-table-move:hover:not(:disabled),
.scm-table-remove:hover:not(:disabled),
.scm-table-toggle:hover {
  background: #eef2f7;
}

.scm-table-move:disabled {
  opacity: 0.32;
  cursor: default;
}

.scm-table-remove {
  border-color: #f0d3d3;
  color: #a83232;
}

.scm-table-remove:hover { background: #fbecec; }

.scm-table-toggle {
  border-color: #2f6fb0;
  color: #2f6fb0;
  font-weight: 700;
}

.scm-table-toggle:hover { background: #eaf2fb; }

/* 展開時の詳細エリア */
.scm-table-card-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5eaf0;
}

.scm-table-card-subsection { margin-bottom: 16px; }
.scm-table-card-subsection:last-child { margin-bottom: 0; }

.scm-table-card-subsection-title {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.scm-table-card-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.scm-table-name-field { flex: 1 1 140px; }
.scm-table-seatcount-field { flex: 0 0 auto; width: 84px; }

/* ── 名前をまとめて入力 ───────────────────────────────────────── */
.scm-bulk-input {
  margin-bottom: 16px;
}

.scm-bulk-hint {
  margin: 6px 0 0;
  color: #8a939f;
  font-size: 0.74rem;
  line-height: 1.5;
}

.scm-bulk-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f6f9fd;
}

.scm-bulk-help {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.55;
}

.scm-bulk-textarea-label {
  display: block;
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
}

.scm-bulk-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 0.85rem;
  resize: vertical;
  margin-bottom: 8px;
}

.scm-bulk-textarea:focus {
  outline: none;
  border-color: #2f6fb0;
  box-shadow: 0 0 0 2px rgba(47, 111, 176, 0.18);
}

.scm-bulk-message {
  margin: 0;
  padding: 7px 9px;
  border-radius: 6px;
  background: #e9f3ea;
  color: #2f6b3a;
  font-size: 0.76rem;
  font-weight: 600;
}

.scm-bulk-message-error {
  background: #fbecec;
  color: #a83232;
}

/* ── 座席カード ───────────────────────────────────────────────── */
.scm-seat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .scm-seat-grid { grid-template-columns: 1fr 1fr; }
}

.scm-seat-card {
  padding: 9px;
  border: 1px solid #e5eaf0;
  border-radius: 7px;
  background: #fff;
}

.scm-seat-index {
  display: block;
  margin-bottom: 6px;
  color: #2f6fb0;
  font-size: 0.72rem;
  font-weight: 700;
}

.scm-seat-fields {
  display: grid;
  gap: 6px;
}

/* 敬称は普段あまり触らないため、既定と異なる席以外は初期状態で隠す */
.scm-seat-honorific {
  margin-top: 6px;
}

.scm-seat-honorific-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.scm-seat-honorific-toggle:hover { color: #2f6fb0; }

.scm-seat-honorific-panel {
  margin-top: 4px;
}

/* ── ボタン ───────────────────────────────────────────────────── */
.scm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #333;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.scm-btn:hover { background: #eef2f7; }

.scm-btn-primary {
  background: #2f6fb0;
  border-color: #2f6fb0;
  color: #fff;
}

.scm-btn-primary:hover { background: #245a91; }

.scm-btn-outline {
  background: #fff;
  border-color: #2f6fb0;
  color: #2f6fb0;
}

.scm-btn-outline:hover { background: #eaf2fb; }

.scm-btn-text-danger {
  min-height: auto;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: #a83232;
  font-size: 0.78rem;
  text-decoration: underline;
}

.scm-btn-text-danger:hover {
  background: transparent;
  color: #7a1f1f;
}

/* ── 保存・クリア ─────────────────────────────────────────────── */
.scm-bottom-section {
  padding: 8px 4px 0;
  border: 0;
  background: transparent;
}

.scm-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scm-save-status {
  margin: 0;
  min-height: 1.2em;
  color: #2f6fb0;
  font-size: 0.78rem;
}

.scm-clear-note {
  margin: 4px 0 0;
  color: #8a939f;
  font-size: 0.72rem;
}

/* ── プレビュー ───────────────────────────────────────────────── */
.scm-preview-card {
  padding: 18px 20px 22px;
}

.scm-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.scm-preview-toolbar .scm-section-title {
  font-size: 1.04rem;
  color: #1f4f8a;
}

.scm-preview-subguide {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 0.77rem;
}

.scm-print-note {
  margin: 0 0 14px;
  color: #8a939f;
  font-size: 0.74rem;
  text-align: right;
}

.scm-preview-options {
  margin-bottom: 12px;
}

.scm-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scm-zoom-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
}

.scm-zoom-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scm-zoom-btn {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.scm-zoom-btn:hover { background: #f4f7fb; }

.scm-zoom-btn.is-active {
  background: #2f6fb0;
  border-color: #2f6fb0;
  color: #fff;
}

#previewSection {
  background: #fbfcfe;
}

.scm-paper-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  border: 1px solid #e3e9f0;
  border-radius: 9px;
  background: #eef2f6;
}

/* JSがscm-paper-stageへ縮小後の実寸widthを明示的に設定するため、
   ここでmargin:autoを効かせないと縮小時(フィット/50%など)に
   左寄せのまま残り、右側の余白だけが大きく見える */
.scm-paper-stage {
  margin: 0 auto;
}

.scm-paper {
  /* 幅はJS側でA4の実寸(向きに応じた実際のmm換算px)を明示的に設定するため、
     ここでCSSの上限を設けるとA4横(約1069px)などで実際の描画幅とズーム計算が
     食い違い、「フィット」が正しく効かなくなる */
  width: 100%;
  min-height: 500px;
  margin: 0 auto;
  padding: 34px 30px;
  border: 1px solid #dbe3ec;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
  /* ズーム(transform:scale)はpaperStageの左上を基準に縮小させる。
     中心基準(既定値)のままだと縮小時に表示位置がずれ、paper-wrapで
     不要な横スクロールが発生する */
  transform-origin: top left;
  /* テーブル数が少なく内容が短いときでも、A4実寸(min-height)いっぱいに
     テーブル配置(.scm-tables-layout)を縦方向に広げて配置するための
     フレックスコンテナ */
  display: flex;
  flex-direction: column;
}

/* フォント設定は用紙内のテキストにのみ適用する */
.scm-paper.scm-font-mincho { font-family: 'Noto Serif JP', serif; }
.scm-paper.scm-font-gothic { font-family: 'Noto Sans JP', sans-serif; }
.scm-paper.scm-font-kleeone { font-family: 'Klee One', sans-serif; }
.scm-paper.scm-font-yujisyuku { font-family: 'Yuji Syuku', serif; }

.scm-paper.scm-fontsize-small { font-size: 0.88rem; }
.scm-paper.scm-fontsize-standard { font-size: 1rem; }
.scm-paper.scm-fontsize-large { font-size: 1.14rem; }

.scm-sample-badge {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fdf3e0;
  color: #9a6b16;
  font-size: 0.74rem;
  font-weight: 700;
}

.scm-preview-title {
  margin: 0 0 4px;
  color: #111827;
  font-size: 1.5em;
  font-weight: 700;
  text-align: center;
}

.scm-preview-event-name {
  margin: 0 0 6px;
  color: #333;
  font-size: 1.1em;
  text-align: center;
}

.scm-preview-meta {
  margin: 0 0 24px;
  color: #6b7280;
  font-size: 0.85em;
  text-align: center;
}

.scm-preview-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #7a8491;
  font-size: 0.9em;
  text-align: center;
  line-height: 1.7;
}

/* ── 座席配置図（円卓・長テーブル） ──────────────────────────── */
/* A4横で8席の円卓4卓が1行に収まる密度を目安に詰めている */
/* テーブルはJS側で行ごとにグループ化される(splitTablesIntoBalancedRows)。
   ここでは行を縦に積み、各行内でテーブルを横並びにする。
   flex:1でA4実寸の用紙いっぱいに広がり、justify-content:centerで
   テーブル数が少なく行間に余裕があるときは縦方向にも均等に広げて
   配置する(用紙の一部に固まって見えるのを防ぐ) */
.scm-tables-layout {
  display: flex;
  flex: 1;
  flex-direction: column;
  /* 各行(.scm-tables-row)を用紙の幅いっぱいに広げ、行数が少なく
     余白がある場合は上下にも均等に間隔をあける(space-evenly)。
     これにより、テーブル数が少なくても用紙全体を使って配置される */
  justify-content: space-evenly;
  gap: 24px;
  margin-top: 4px;
}

.scm-tables-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-evenly;
  gap: 16px;
}

.scm-seat-chip {
  padding: 2px 3px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  text-align: center;
}

.scm-seat-chip-empty {
  border-style: dashed;
  color: #b7bfc9;
  font-size: 0.74em;
}

.scm-seat-chip-name {
  margin: 0;
  color: #1f2937;
  font-size: 0.68em;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.scm-seat-chip-role {
  margin: 1px 0 0;
  color: #6b7280;
  font-size: 0.62em;
  line-height: 1.15;
  overflow-wrap: break-word;
}

/* 円卓：中心のテーブル名(hub)の周囲へ座席をJSで計算した座標に配置する */
.scm-round-table {
  position: relative;
  margin: 0 auto;
}

.scm-round-table-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 3px;
  border: 1.5px solid #94a3b8;
  border-radius: 50%;
  background: #f2f6fb;
  text-align: center;
}

.scm-round-table-hub span {
  color: #1f4f8a;
  font-size: 0.74em;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.scm-round-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 58px;
}

/* 長テーブル：上段・下段に座席を均等配置し、中央にテーブル名の帯を置く */
.scm-long-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scm-long-table-row {
  display: flex;
  gap: 6px;
}

.scm-long-table-bar {
  min-width: 120px;
  padding: 5px 12px;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  background: #f2f6fb;
  text-align: center;
}

.scm-long-table-bar span {
  color: #1f4f8a;
  font-size: 0.82em;
  font-weight: 700;
}

.scm-long-seat {
  width: 58px;
}

/* ── 解説エリア ───────────────────────────────────────────────── */
.scm-doc-section {
  max-width: 900px;
  margin: 44px auto 56px;
  padding: 0 18px;
  line-height: 1.8;
  color: #374151;
}

.scm-doc-section h2 {
  font-size: 1.22rem;
  font-weight: 700;
  margin: 38px 0 14px;
  color: #111827;
  border-left: 4px solid #2f6fb0;
  padding-left: 10px;
}

.scm-doc-section h2:first-of-type { margin-top: 0; }

.scm-doc-section p,
.scm-doc-section li {
  font-size: 0.94rem;
  line-height: 1.9;
  color: #374151;
}

.scm-doc-section p { margin: 0 0 12px; }
.scm-doc-section ul { margin: 0 0 12px; padding-left: 1.4em; }
.scm-doc-section li { margin-bottom: 4px; }

.scm-doc-section a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.scm-steps {
  list-style: none;
  counter-reset: scm-step;
  padding: 0;
  margin: 0 0 14px;
}

.scm-steps li {
  position: relative;
  padding: 10px 0 12px 34px;
  border-bottom: 1px solid #f3f4f6;
}

.scm-steps li:last-child { border-bottom: none; }

.scm-steps li::before {
  counter-increment: scm-step;
  content: counter(scm-step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f6fb0;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scm-faq-item {
  border-bottom: 1px solid #f3f4f6;
  padding: 12px 0;
}

.scm-faq-item:last-child { border-bottom: none; }

.scm-faq-q {
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
}

.scm-faq-a { margin: 0; }

.scm-related-pages {
  margin-top: -10px;
}

.scm-related-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scm-related-link-list li {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.scm-related-link-list a {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.scm-related-link-list a:hover { text-decoration: underline; }

.scm-related-link-list .scm-note {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 400;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .scm-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .scm-steps li {
    min-height: 110px;
    padding: 14px 14px 14px 46px;
    border: 1px solid #e5eaf0;
    border-radius: 9px;
    background: #fff;
  }

  .scm-steps li::before {
    left: 14px;
    top: 15px;
  }
}

@media (max-width: 767px) {
  .scm-doc-section {
    margin-top: 34px;
    margin-bottom: 46px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .scm-doc-section h2 {
    margin-top: 32px;
    font-size: 1.14rem;
  }
}

/* ── スマホ固定操作バー ───────────────────────────────────────── */
.scm-mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e4e9f0;
  background: #fff;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.1);
}

.scm-mobile-action-bar .scm-btn {
  flex: 1 1 0;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

@media (min-width: 992px) {
  .scm-mobile-action-bar { display: none; }
}

/* ── レスポンシブ ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .scm-breadcrumb,
  .scm-seo-header,
  .scm-main-container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .scm-seo-header h1 { font-size: 1.28rem; }

  .scm-feature-list {
    gap: 4px 10px;
    font-size: 0.76rem;
  }

  .scm-quick-flow-steps {
    justify-content: flex-start;
    font-size: 0.75rem;
  }

  .scm-section-card {
    padding: 14px 12px;
  }

  .scm-setting-section {
    padding: 14px 12px;
  }

  .scm-preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .scm-preview-toolbar .scm-btn { width: 100%; }

  .scm-paper-wrap { padding: 8px; }

  .scm-paper {
    min-height: 420px;
    padding: 26px 18px;
  }

  .scm-save-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  /* スマートフォンでは指で操作しやすいよう、タップ領域を確保する */
  .scm-segmented-option span { min-height: 44px; }
  .scm-zoom-btn { min-height: 40px; }
  .scm-print-note { text-align: left; }
  .scm-field input,
  .scm-field select { min-height: 42px; }
  .scm-table-move,
  .scm-table-remove,
  .scm-table-toggle { min-height: 42px; }
  .scm-seat-honorific-toggle { min-height: 38px; }
  .scm-btn-link { min-height: 42px; }
}

@media (max-width: 480px) {
  .scm-quick-flow-steps span[aria-hidden="true"] { display: none; }

  .scm-quick-flow-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ── 印刷 ─────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }

  body {
    padding-bottom: 0;
    background: #fff;
  }

  .scm-main-container {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .scm-main-grid { display: block; }

  /* 画面用のsticky/スクロール指定が印刷時に内容を切り詰めないよう解除する */
  .scm-col-preview {
    position: static;
    max-height: none;
    overflow: visible;
  }

  #previewSection {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .scm-paper-wrap {
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .scm-paper {
    max-width: none;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  /* テーブル数が多く複数ページにまたがる場合でも、1つのテーブルの
     座席配置図がページの途中で分断されないようにする */
  .scm-round-table,
  .scm-long-table {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  @page {
    size: A4 landscape;
    margin: 15mm;
  }
}
