/* ==========================================================================
   メール署名作成ツール
   PC: 左に入力フォーム / 右にプレビュー（sticky）
   SP: 入力 → プレビュー → コピー操作 の1カラム
   ========================================================================== */

*, *::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, input, select, textarea { font-family: inherit; }

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

/* ── パンくず・導入 ───────────────────────────────────────────── */
.esm__breadcrumb,
.esm__seo-header,
.esm__main-container,
.esm__doc-section {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.esm__breadcrumb { margin-top: 14px; padding: 0 16px; }

.esm__seo-header {
  margin-top: 10px;
  margin-bottom: 22px;
  padding: 0 16px;
}

.esm__seo-header h1 {
  margin: 0 0 8px;
  font-size: 1.58rem;
  font-weight: 700;
  line-height: 1.4;
}

.esm__seo-lead {
  margin: 0;
  max-width: 760px;
  color: #444;
  line-height: 1.75;
}

/* ── メインレイアウト ─────────────────────────────────────────── */
.esm__main-container {
  margin-bottom: 48px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(320px, 55fr) minmax(300px, 45fr);
  gap: 20px;
  align-items: start;
}

.esm__form-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.esm__card {
  background: #fff;
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  padding: 22px 22px 18px;
}

.esm__block-title {
  margin: 0 0 14px;
  font-size: .95rem;
  font-weight: 700;
  color: #374151;
}

/* ── ツールバー（サンプル・全削除） ───────────────────────────── */
.esm__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── フォーム項目 ───────────────────────────────────────────── */
.esm__form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.esm__form-field:last-child { margin-bottom: 0; }

.esm__form-field label {
  font-size: .85rem;
  font-weight: 600;
  color: #4b5563;
}

.esm__form-field input[type="text"],
.esm__form-field input[type="email"],
.esm__form-field textarea,
.esm__form-field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: .95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
}

.esm__form-field textarea {
  min-height: 60px;
  resize: vertical;
  line-height: 1.5;
}

.esm__form-field input:focus,
.esm__form-field textarea:focus,
.esm__form-field select:focus {
  border-color: #2f6fb0;
}

/* ── 住所・その他の連絡先／詳細設定（折りたたみ） ───────────────────── */
.esm__more-summary,
.esm__advanced-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: .9rem;
  font-weight: 700;
  color: #2f6fb0;
  cursor: pointer;
  list-style: none;
}

.esm__more-summary::-webkit-details-marker,
.esm__advanced-summary::-webkit-details-marker { display: none; }

.esm__toggle-icon::before { content: "＋"; }
details[open] > summary .esm__toggle-icon::before { content: "－"; }

.esm__more-body,
.esm__advanced-body {
  padding-top: 14px;
}

.esm__sub-heading {
  margin: 6px 0 10px;
  padding-top: 10px;
  border-top: 1px solid #eef1f5;
  font-size: .82rem;
  font-weight: 700;
  color: #6b7280;
}

/* ── 詳細設定（表示ON/OFF） ───────────────────────────────────── */
.esm__advanced-details { padding-bottom: 18px; }

.esm__advanced-hint {
  margin: 0 0 12px;
  font-size: .8rem;
  color: #6b7280;
}

.esm__visibility-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}

.esm__visibility-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  font-size: .86rem;
  color: #374151;
  cursor: pointer;
}

.esm__visibility-item input { flex: 0 0 auto; width: 16px; height: 16px; }

.esm__design-reset-btn {
  margin-top: 10px;
  padding-left: 0;
}

/* ── ボタン ───────────────────────────────────────────── */
.esm__btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  background: #1d4ed8;
  border: 1px solid #1d4ed8;
  color: #fff;
}

.esm__btn-primary:hover { background: #1e40af; }

.esm__btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  border: 1px solid #2f6fb0;
  color: #2f6fb0;
}

.esm__btn-outline:hover { background: #eff6ff; }

.esm__btn-text {
  background: none;
  border: none;
  padding: 6px 4px;
  font-size: .85rem;
  color: #9ca3af;
  text-decoration: underline;
  cursor: pointer;
}

.esm__btn-text:hover { color: #6b7280; }

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

.esm__auto-save-note {
  font-size: .78rem;
  color: #9ca3af;
}

/* ── プレビュー ───────────────────────────────────────────── */
.esm__preview-column {
  position: sticky;
  top: 20px;
}

.esm__preview-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.esm__preview-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
}

.esm__preview-sample-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: .72rem;
  font-weight: 600;
}

.esm__preview-box {
  margin-bottom: 18px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  min-height: 160px;
}

.esm__preview-pre {
  margin: 0;
  font-family: inherit;
  font-size: .92rem;
  line-height: 1.7;
  color: #1f2937;
}

.esm__preview-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.esm__preview-emphasis {
  font-weight: 700;
  font-size: 1.15em;
}

.esm__copy-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.esm__copy-status {
  font-size: .82rem;
  color: #16a34a;
  font-weight: 600;
}

.esm__note-small {
  margin: 0 0 16px;
  font-size: .74rem;
  color: #9ca3af;
  line-height: 1.6;
}

.esm__guide-note {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid #eef1f5;
  font-size: .82rem;
  color: #6b7280;
  line-height: 1.7;
}

/* ── 解説・FAQセクション ───────────────────────────────────── */
.esm__doc-section {
  margin-top: 40px;
  margin-bottom: 60px;
  padding: 0 16px;
  color: #374151;
  line-height: 1.85;
}

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

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

.esm__doc-section h3 {
  margin: 0 0 6px;
  color: #1d4ed8;
  font-size: 1rem;
  font-weight: 700;
}

.esm__doc-section p,
.esm__doc-section li {
  color: #374151;
  font-size: .92rem;
  line-height: 1.85;
}

.esm__doc-section p { margin: 0 0 12px; }
.esm__doc-section a { color: #1d4ed8; font-weight: 600; }
.esm__doc-section ul,
.esm__doc-section ol.esm__step-list { margin: 0 0 12px; padding-left: 1.4em; }

.esm__faq-item {
  margin-bottom: 10px;
  padding: 13px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.esm__faq-item p { margin: 0; }

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-links li a {
  display: block;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: #1d4ed8;
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
}

.related-links li a:hover { background: #eff6ff; }

/* ── レスポンシブ ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .esm__main-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .esm__form-column { order: 1; }
  .esm__preview-column {
    order: 2;
    position: static;
  }
}

@media (max-width: 560px) {
  .esm__actions { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .esm__toolbar { flex-wrap: wrap; }
  .esm__visibility-grid { grid-template-columns: 1fr; }
}
