/* ==========================================================================
   チェックリスト作成・印刷ツール専用スタイル
   すべてのカスタムクラスは clm- プレフィックスを付け、既存Bizroute CSSと
   衝突しないようにする。
   ========================================================================== */

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

[hidden] { display: none !important; }

body {
  background: #f7f8fa;
}

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

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

/* ── パンくず・ページ見出し ────────────────────────────────────────── */
.clm-breadcrumb {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 0 20px;
}

.clm-seo-header {
  max-width: 1180px;
  margin: 6px auto 0;
  padding: 0 20px 10px;
}

.clm-seo-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px;
}

.clm-seo-lead {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* ── 2カラムレイアウト ────────────────────────────────────────────── */
.clm-main-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px 40px;
}

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

@media (min-width: 992px) {
  .clm-main-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }
  .clm-col-preview {
    position: sticky;
    top: 20px;
  }
}

.clm-section-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 20px 20px 22px;
}

/* ── 設定フォーム ─────────────────────────────────────────────────── */
.clm-setting-section {
  margin-bottom: 22px;
}
.clm-setting-section:last-child { margin-bottom: 0; }

.clm-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef0f3;
}

.clm-form-field { margin-bottom: 14px; }
.clm-form-field:last-child { margin-bottom: 0; }

.clm-form-field label,
.clm-form-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.clm-form-field input[type="text"],
.clm-form-field input[type="date"],
.clm-form-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #111827;
  background: #fff;
}

.clm-form-field input:focus,
.clm-form-field select:focus {
  outline: 2px solid #2f6fb0;
  outline-offset: 1px;
  border-color: #2f6fb0;
}

.clm-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.clm-two-col .clm-form-field { margin-bottom: 14px; }

.clm-hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0 0 10px;
  line-height: 1.6;
}

.clm-checkbox-field { margin-bottom: 16px; }
.clm-checkbox-field:last-child { margin-bottom: 0; }

.clm-checkbox-field .clm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

.clm-checkbox-hint {
  margin: 4px 0 0 26px;
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.5;
}

.clm-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2f6fb0;
  cursor: pointer;
}

/* ── チェック項目リスト（入力側） ─────────────────────────────────── */
.clm-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 2px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafbfc;
}

.clm-row-heading {
  background: #eef4fb;
  border-color: #cfe0f2;
}

.clm-handle {
  flex: 0 0 auto;
  width: 30px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9aa4b2;
  font-size: 1.05rem;
  cursor: grab;
  touch-action: none;
  border-radius: 6px;
  padding: 0;
}
.clm-handle:hover { background: #eef2f7; color: #374151; }
.clm-handle:active { cursor: grabbing; }

.clm-row-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #111827;
  background: #fff;
}
.clm-row-heading .clm-row-input {
  font-weight: 700;
}
.clm-row-input:focus {
  outline: 2px solid #2f6fb0;
  outline-offset: 1px;
  border-color: #2f6fb0;
}

.clm-row-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}

.clm-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}
.clm-icon-btn:hover { background: #f3f4f6; }
.clm-icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.clm-icon-btn-danger { color: #b3261e; }
.clm-icon-btn-danger:hover { background: #fdecec; }

.clm-row-placeholder {
  border: 2px dashed #9db8d6;
  border-radius: 8px;
  background: #eef4fb;
}

.clm-row-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  opacity: 0.95;
  margin: 0;
}

.clm-add-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.clm-example-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #f3f7fc;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
}

.clm-example-text {
  font-size: 0.85rem;
  color: #374151;
}

.clm-example-link {
  flex: 0 0 auto;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2f6fb0;
  background: #fff;
  border: 1px solid #2f6fb0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.clm-example-link:hover { background: #eaf2fb; }

/* ── 文字サイズ（セグメント切替） ─────────────────────────────────── */
.clm-segmented {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.clm-segmented-option {
  position: relative;
  padding: 8px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  background: #fff;
}
.clm-segmented-option + .clm-segmented-option {
  border-left: 1px solid #d1d5db;
}

.clm-segmented-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.clm-segmented-option:has(input:checked) {
  background: #2f6fb0;
  color: #fff;
}

.clm-segmented-option:has(input:focus-visible) {
  outline: 2px solid #2f6fb0;
  outline-offset: 2px;
}

/* ── その他の設定 ─────────────────────────────────────────────────── */
.clm-advanced-settings {
  margin: 2px 0 22px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
}

.clm-advanced-settings summary {
  position: relative;
  padding: 12px 40px 12px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  list-style: none;
}
.clm-advanced-settings summary::-webkit-details-marker { display: none; }

.clm-advanced-settings summary::after {
  content: "＋";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 1rem;
}
.clm-advanced-settings[open] summary::after { content: "−"; }

.clm-advanced-inner {
  padding: 4px 14px 14px;
  border-top: 1px solid #eef0f3;
}

/* ── 保存状態・ボタン ─────────────────────────────────────────────── */
.clm-bottom-section {
  padding-top: 16px;
  border-top: 1px solid #eef0f3;
}

.clm-save-status {
  min-height: 1.1em;
  font-size: 0.78rem;
  color: #2f7d4f;
  margin: 0 0 4px;
}

.clm-privacy-note {
  font-size: 0.76rem;
  color: #6b7280;
  margin: 0 0 10px;
  line-height: 1.6;
}

.clm-print-error {
  font-size: 0.84rem;
  font-weight: 700;
  color: #b3261e;
  background: #fdecec;
  border: 1px solid #f3c6c6;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 12px;
}

.clm-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.clm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f8f9fb;
  color: #374151;
  cursor: pointer;
  min-height: 44px;
}
.clm-btn:hover { background: #eef2f7; }

.clm-btn-primary {
  background: #2f6fb0;
  border-color: #2f6fb0;
  color: #fff;
}
.clm-btn-primary:hover { background: #245a91; }

.clm-btn-outline {
  background: #fff;
  border-color: #2f6fb0;
  color: #2f6fb0;
}
.clm-btn-outline:hover { background: #eaf2fb; }

.clm-btn-text-danger {
  background: transparent;
  border-color: transparent;
  color: #b3261e;
  padding-left: 6px;
  padding-right: 6px;
}
.clm-btn-text-danger:hover { color: #7a1f1f; text-decoration: underline; }

/* ── プレビューツールバー ─────────────────────────────────────────── */
.clm-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ── A4プレビュー ─────────────────────────────────────────────────── */
.clm-paper-scale-wrap {
  overflow-x: auto;
  padding: 4px 0 6px;
}

.clm-paper-stage {
  display: flex;
  justify-content: center;
}

.clm-paper {
  flex: none;
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
  outline: 1px solid #e4e9f0;
  outline-offset: -1px;
  padding: 18mm 16mm 16mm;
  color: #111827;
  font-family: "游ゴシック体", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  transform-origin: top center;
}

.clm-paper-header {
  text-align: center;
  margin-bottom: 6mm;
}

.clm-paper-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 3mm;
}

.clm-paper-meta {
  text-align: right;
  font-size: 12px;
  line-height: 1.7;
  color: #374151;
}
.clm-paper-meta p { margin: 0; }

.clm-paper-divider {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0 0 12mm;
}

.clm-paper-items[data-fontsize="sm"] { font-size: 13px; }
.clm-paper-items[data-fontsize="md"] { font-size: 15px; }
.clm-paper-items[data-fontsize="lg"] { font-size: 17px; }

.clm-prev-empty {
  color: #9ca3af;
  font-size: 13px;
  padding: 6px 0;
}

.clm-prev-heading {
  font-weight: 700;
  font-size: 1.1em;
  margin: 6mm 0 2mm;
  padding-bottom: 1mm;
  border-bottom: 1px solid #333;
  break-after: avoid-page;
  break-inside: avoid;
}
.clm-prev-heading:first-child { margin-top: 0; }

.clm-prev-item {
  display: flex;
  align-items: flex-start;
  gap: 2.5mm;
  padding: 2mm 0;
  border-bottom: 1px dashed #e5e7eb;
  break-inside: avoid;
}
.clm-prev-item.clm-after-heading { break-before: avoid-page; }

.clm-prev-checkbox {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  min-width: 14px;
  min-height: 14px;
  margin-top: 0.2em;
  border: 1.6px solid #333;
  border-radius: 2px;
}

.clm-prev-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.55;
  word-break: break-word;
  padding-top: 0.05em;
}

.clm-prev-memo-line {
  flex: 0 0 30mm;
  height: 1.5em;
  border-bottom: 1px solid #999;
}

.clm-paper-footer-memo {
  margin-top: 8mm;
  break-inside: avoid;
}

.clm-footer-memo-label {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 4mm;
}

.clm-footer-memo-line {
  height: 8mm;
  border-bottom: 1px solid #999;
}

/* ── 使い方ステップ・FAQ（他ツールと統一） ────────────────────────── */
.clm-steps {
  list-style: none;
  counter-reset: clm-step;
  padding: 0;
  margin: 0 0 14px;
}

.clm-steps li {
  position: relative;
  padding: 8px 0 10px 34px;
  margin-bottom: 0;
  border-bottom: 1px solid #f3f4f6;
}
.clm-steps li:last-child { border-bottom: none; }

.clm-steps li::before {
  counter-increment: clm-step;
  content: counter(clm-step);
  position: absolute;
  left: 0;
  top: 8px;
  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;
}

.faq-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: #fff;
}
.faq-box h3 { margin-top: 0; }
.faq-box p:last-child { margin-bottom: 0; }

.related-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-link-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.92rem;
}
.related-link-list li:last-child { border-bottom: none; }

.related-link-list a {
  color: #2f6fb0;
  font-weight: 600;
  text-decoration: none;
}
.related-link-list a:hover { text-decoration: underline; }

.clm-note { color: #6b7280; font-size: 0.85rem; }

.seo-content {
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 0 20px 40px;
}

.seo-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 40px 0 14px;
  color: #111827;
  border-left: 4px solid #2f6fb0;
  padding-left: 10px;
}
.seo-content h2:first-of-type { margin-top: 0; }

.seo-content p,
.seo-content li {
  color: #374151;
  font-size: 0.92rem;
  line-height: 1.85;
}
.seo-content p { margin: 0 0 12px; }

/* ── モバイル固定アクションバー ───────────────────────────────────── */
.clm-mobile-action-bar {
  display: none;
}

@media (max-width: 991px) {
  .clm-mobile-action-bar {
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
  }
  .clm-mobile-action-bar .clm-btn { flex: 1 1 0; }
}

@media (max-width: 640px) {
  .clm-two-col { grid-template-columns: 1fr; }
  .clm-section-card { padding: 16px 14px 18px; }
}

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

  body { background: #fff; }

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

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

  .clm-col-preview .clm-section-card {
    box-shadow: none !important;
    border: none;
    border-radius: 0;
    padding: 0;
  }

  .clm-paper-scale-wrap {
    overflow: visible;
    padding: 0;
  }

  .clm-paper {
    box-shadow: none !important;
    outline: none;
    margin: 0 auto;
    min-height: 0;
    transform: none !important;
    zoom: 1 !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}


/* ==========================================================================
   UI改善 2026-08-13
   タイトル→チェック項目を最短導線にし、補助設定を折りたたみに集約
   ========================================================================== */

.clm-title-section {
  margin-bottom: 18px;
}

.clm-main-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 7px;
}

.clm-title-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 1rem;
}

.clm-title-input:focus {
  outline: 2px solid #2f6fb0;
  outline-offset: 1px;
  border-color: #2f6fb0;
}

.clm-items-section {
  margin-bottom: 18px;
}

.clm-items-section .clm-section-title {
  margin-bottom: 7px;
}

.clm-hint-primary {
  margin-bottom: 2px;
  font-size: 0.82rem;
  color: #4b5563;
}

.clm-hint-secondary {
  margin-bottom: 10px;
  font-size: 0.74rem;
  color: #8993a1;
}

.clm-add-btn-row {
  align-items: center;
}

.clm-btn-add-main {
  min-width: 190px;
}

.clm-btn-subtle {
  min-height: 40px;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  color: #2f6fb0;
  font-size: 0.86rem;
}

.clm-btn-subtle:hover {
  background: #eef4fb;
  border-color: #d8e5f3;
}

.clm-advanced-settings {
  margin-top: 4px;
  margin-bottom: 18px;
}

.clm-advanced-settings summary {
  padding-top: 11px;
  padding-bottom: 11px;
}

.clm-advanced-inner {
  padding-top: 12px;
}

.clm-advanced-block + .clm-advanced-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.clm-advanced-title {
  margin: 0 0 12px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #374151;
}

.clm-bottom-section {
  margin-top: 0;
  padding-top: 12px;
}

.clm-privacy-note {
  margin-bottom: 6px;
}

.clm-clear-row {
  display: flex;
  justify-content: flex-start;
}

.clm-preview-toolbar .clm-section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

@media (min-width: 992px) {
  .clm-col-input .clm-section-card {
    padding-top: 18px;
  }
}

@media (max-width: 640px) {
  .clm-btn-add-main {
    width: 100%;
  }

  .clm-btn-subtle {
    width: 100%;
  }

  .clm-hint-primary {
    font-size: 0.8rem;
  }

  .clm-hint-secondary {
    font-size: 0.72rem;
  }
}
