/* ==========================================================================
   住所録・宛名リスト作成ツール 専用CSS
   すべてのカスタムクラスは alm- プレフィックスを付け、既存Bizroute CSSと
   衝突しないようにする。全体レイアウトは指示によりPC/SPとも縦1カラム。
   ========================================================================== */

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::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: 64px; }
}

.alm-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── パンくず・見出し ─────────────────────────────────────────────── */
.alm-breadcrumb {
  max-width: 900px;
  margin: 14px auto 0;
  padding: 0 16px;
}

.alm-seo-header {
  max-width: 900px;
  margin: 10px auto 16px;
  padding: 0 16px;
}

.alm-seo-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.alm-seo-lead {
  color: #444;
  margin-bottom: 14px;
  line-height: 1.75;
}

.alm-quick-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f7faff;
  color: #315d8c;
  font-size: 0.82rem;
  font-weight: 600;
  list-style: none;
}

/* ── メインレイアウト（縦1カラム固定） ───────────────────────────── */
.alm-main-container {
  max-width: 900px;
  margin: 0 auto 48px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.alm-section-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e4e9f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.alm-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f4f8a;
  margin: 0 0 14px;
}

/* ── フォーム部品 ─────────────────────────────────────────────────── */
.alm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 560px) {
  .alm-form-grid { grid-template-columns: minmax(0, 1fr); }
}

.alm-form-field {
  margin-bottom: 14px;
}

.alm-form-grid .alm-form-field { margin-bottom: 14px; }

.alm-form-field:last-child,
form > .alm-form-field:last-of-type { margin-bottom: 14px; }

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

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

.alm-form-field textarea { min-height: 60px; resize: vertical; }

.alm-checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #333;
  cursor: pointer;
}

.alm-address-group {
  border: 1px solid #e9edf2;
  border-radius: 10px;
  padding: 14px 14px 2px;
  margin: 0 0 14px;
}

.alm-address-group legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: #315d8c;
  padding: 0 6px;
}

.alm-postal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alm-postal-mark { color: #666; font-weight: 600; }

.alm-postal-row input { flex: 1 1 auto; min-width: 0; }

.alm-field-note {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 6px 0 0;
  min-height: 1em;
}

.alm-duplicate-warning {
  background: #fff8e8;
  border: 1px solid #f0d38e;
  color: #7a5b12;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.84rem;
  margin: 0 0 14px;
}

.alm-details-toggle {
  border: 1px solid #e4e9f0;
  border-radius: 8px;
  padding: 2px 12px;
  margin: 0 0 16px;
}

.alm-details-toggle summary {
  cursor: pointer;
  padding: 10px 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2f6fb0;
  list-style: none;
}

.alm-details-toggle summary::-webkit-details-marker { display: none; }

.alm-details-toggle summary::before {
  content: "▸ ";
}

.alm-details-toggle[open] summary::before {
  content: "▾ ";
}

.alm-details-inner {
  padding: 4px 0 12px;
}

.alm-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── ボタン共通 ───────────────────────────────────────────────────── */
.alm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 42px;
  cursor: pointer;
}

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

.alm-btn:disabled { opacity: 0.45; cursor: default; }
.alm-btn:disabled:hover { background: #f8fafc; }

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

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

.alm-btn-subtle {
  background: #fff;
  border-color: #cbd5e1;
  color: #475569;
}
.alm-btn-subtle:hover { background: #f1f5f9; }

.alm-btn-danger-outline {
  background: #fff;
  border-color: #d99b9b;
  color: #a83232;
}
.alm-btn-danger-outline:hover:not(:disabled) { background: #fbecec; }

.alm-btn-text {
  background: none;
  border: none;
  color: #2f6fb0;
  text-decoration: underline;
  padding: 6px 4px;
  min-height: auto;
}

.alm-btn-text-danger {
  background: none;
  border: none;
  color: #a83232;
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 10px 4px;
  min-height: 40px;
}
.alm-btn-text-danger:hover { color: #7a1f1f; }

.alm-btn-sm {
  padding: 7px 12px;
  min-height: 34px;
  font-size: 0.82rem;
}

.alm-btn-icon {
  padding: 7px 10px;
  min-height: 34px;
  font-size: 0.78rem;
  background: #fff;
  color: #475569;
}

/* ── 一覧：見出し・ツールバー ─────────────────────────────────────── */
.alm-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 12px;
}

.alm-list-header .alm-section-title { margin: 0; }

.alm-count-text {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
  margin: 0;
}

.alm-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.alm-search-field { flex: 1 1 220px; }
.alm-search-field label { margin-bottom: 6px; }

.alm-sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alm-sort-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.alm-sort-field select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 38px;
  background: #fff;
}

.alm-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 10px;
  border-top: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
}

.alm-bulk-select-group,
.alm-bulk-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.alm-selected-count {
  font-size: 0.82rem;
  color: #2f6fb0;
  font-weight: 600;
}

/* ── 一覧テーブル ─────────────────────────────────────────────────── */
.alm-list-wrap { position: relative; }

.alm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.alm-table th,
.alm-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
  vertical-align: middle;
}

.alm-table thead th {
  color: #52606d;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

.alm-table .alm-col-check,
.alm-table .alm-col-handle {
  width: 32px;
  text-align: center;
}

.alm-table[data-sort-mode="auto"] .alm-col-handle { display: none; }

/* PC表示のみ列幅を固定し、住所が長くても他の列を圧迫しないようにする
   （table-layout:fixedはスマホのカード表示側の width:100% と特異性が
   競合するため、カード表示に切り替わるブレークポイントより上でのみ適用） */
@media (min-width: 768px) {
  .alm-table { table-layout: fixed; }

  .alm-table th:nth-child(3), .alm-table td:nth-child(3) { width: 13%; }
  .alm-table th:nth-child(4), .alm-table td:nth-child(4) { width: 15%; }
  .alm-table th:nth-child(5), .alm-table td:nth-child(5) { width: 9%; }
  .alm-table th:nth-child(6), .alm-table td:nth-child(6) { width: 28%; }
  .alm-table th:nth-child(7), .alm-table td:nth-child(7) { width: 12%; }
  .alm-table th:nth-child(8), .alm-table td:nth-child(8) { width: 150px; }

  .alm-table td:nth-child(3),
  .alm-table td:nth-child(4),
  .alm-table td:nth-child(6) {
    overflow-wrap: anywhere;
  }
}

.alm-drag-handle {
  border: none;
  background: none;
  cursor: grab;
  touch-action: none;
  font-size: 1rem;
  color: #94a3b8;
  padding: 4px;
}

.alm-row-dragging {
  background: #eaf2fb;
  outline: 1px dashed #2f6fb0;
}

.alm-col-actions { white-space: nowrap; }

.alm-row-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alm-icon-btn {
  border: 1px solid #dbe3ec;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 5px 9px;
  font-size: 0.78rem;
  cursor: pointer;
}
.alm-icon-btn:hover { background: #eef2f7; }

.alm-icon-btn-danger { color: #a83232; border-color: #f0d3d3; }
.alm-icon-btn-danger:hover { background: #fbecec; }

.alm-no-result {
  text-align: center;
  color: #6b7280;
  padding: 24px 8px !important;
}

.alm-empty-state {
  text-align: center;
  padding: 32px 12px;
  color: #475569;
}
.alm-empty-state p { margin: 0 0 6px; }
.alm-empty-state .alm-btn { margin-top: 12px; }

/* ── スマートフォン：カード表示 ───────────────────────────────────── */
@media (max-width: 767px) {
  .alm-table thead { display: none; }
  .alm-table, .alm-table tbody, .alm-table tr, .alm-table td {
    display: block;
    width: 100%;
  }

  .alm-table tr[data-id] {
    position: relative;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    padding: 10px 12px 10px 40px;
    margin-bottom: 10px;
    background: #fff;
  }

  .alm-table td {
    border: none;
    padding: 3px 0;
  }

  .alm-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 1px;
  }

  .alm-table td:empty { display: none; }

  .alm-table td.alm-col-check {
    position: absolute;
    top: 12px;
    left: 8px;
    width: auto;
  }

  .alm-table td.alm-col-handle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: auto;
  }

  .alm-table td.alm-col-actions {
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid #eef1f5;
  }
}

/* ── プレビュー：ツールバー・設定 ─────────────────────────────────── */
.alm-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.alm-preview-toolbar .alm-section-title { margin: 0; }

.alm-preview-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px;
  margin-bottom: 14px;
  background: #f9fafb;
  border: 1px solid #eef1f5;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .alm-preview-settings { grid-template-columns: minmax(0, 1fr); }
}

.alm-segmented {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}

.alm-segmented-option {
  position: relative;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
  color: #334155;
}
.alm-segmented-option + .alm-segmented-option { border-left: 1px solid #cbd5e1; }
.alm-segmented-option input { position: absolute; opacity: 0; }
.alm-segmented-option input:checked + span { font-weight: 700; }
.alm-segmented-option:has(input:checked) { background: #eaf2fb; color: #1f4f8a; }
.alm-segmented-option:has(input:focus-visible) { outline: 2px solid #2f6fb0; outline-offset: 2px; }

.alm-column-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.alm-column-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: #334155;
  cursor: pointer;
}

.alm-save-status {
  font-size: 0.78rem;
  color: #16a34a;
  min-height: 1.1em;
  margin: 0 0 4px;
}

.alm-privacy-note {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0 0 14px;
}

.alm-csv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef1f5;
}

/* ── A4プレビュー ─────────────────────────────────────────────────── */
.alm-paper-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.alm-paper-stage {
  position: relative;
  margin: 0 auto;
}

.alm-paper-pages {
  width: max-content;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alm-preview-empty {
  text-align: center;
  color: #6b7280;
  padding: 40px 12px;
}

.alm-page {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 4px;
  width: 210mm;
  min-height: 297mm;
  padding: 12mm 8mm;
  box-sizing: border-box;
}

.alm-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 12px;
}

.alm-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.alm-print-table th,
.alm-print-table td {
  border: 1px solid #333;
  padding: 6px 8px;
  font-size: 0.86rem;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.alm-print-table th { background: #f3f5f8; }

/* 表示する項目はチェックボックスで可変のため、列の位置(nth-child)ではなく
   キーに対応するクラス(alm-pc-*)で幅を指定し、住所が他の列を圧迫しない
   ようにする。合計が100%でなくても、table-layout:fixedのもとでは
   おおむね指定した比率で配分される。 */
.alm-print-table .alm-pc-name { width: 16%; }
.alm-print-table .alm-pc-company { width: 20%; }
.alm-print-table .alm-pc-postalCode { width: 12%; }
.alm-print-table .alm-pc-address { width: 34%; }
.alm-print-table .alm-pc-phone { width: 18%; }
.alm-print-table .alm-pc-kana { width: 14%; }
.alm-print-table .alm-pc-department { width: 12%; }
.alm-print-table .alm-pc-position { width: 10%; }
.alm-print-table .alm-pc-email { width: 20%; }
.alm-print-table .alm-pc-honorific { width: 8%; }
.alm-print-table .alm-pc-memo { width: 20%; }

.alm-page[data-layout="compact"] .alm-print-table th,
.alm-page[data-layout="compact"] .alm-print-table td {
  font-size: 0.72rem;
  padding: 3px 6px;
}

.alm-page[data-layout="namecheck"] .alm-print-table th,
.alm-page[data-layout="namecheck"] .alm-print-table td {
  font-size: 1.05rem;
  padding: 10px 10px;
}

.alm-page-number {
  text-align: right;
  font-size: 0.78rem;
  color: #6b7280;
  margin: 10px 0 0;
}

/* ── データ削除 ───────────────────────────────────────────────────── */
.alm-danger-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ── トースト通知 ─────────────────────────────────────────────────── */
.alm-toast-region {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 992px) {
  .alm-toast-region { bottom: 24px; }
}

.alm-toast {
  background: #1f2937;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.alm-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── CSV読み込みモーダル ─────────────────────────────────────────── */
.alm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  padding: 16px;
}

.alm-modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.alm-modal h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: #1f4f8a;
}

.alm-modal-desc {
  font-size: 0.86rem;
  color: #444;
  margin: 0 0 16px;
}

.alm-modal-btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alm-modal-btn-row .alm-btn { width: 100%; }

/* ── モバイル操作バー ─────────────────────────────────────────────── */
.alm-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));
  background: #fff;
  border-top: 1px solid #e4e9f0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.alm-mobile-action-bar .alm-btn {
  flex: 1 1 0;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

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

/* ── 解説・FAQ・関連リンク ───────────────────────────────────────────
   address-label-12.html / envelope-address-print.html の解説エリアと
   装飾を揃えている（見出しの左ボーダー、box/steps/faq-item/related-links）。
   ────────────────────────────────────────────────────────────────── */
.alm-doc-section {
  max-width: 900px;
  margin: 40px auto 60px;
  padding: 0 16px;
  line-height: 1.85;
  color: #374151;
}

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

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

.alm-doc-section h3 {
  margin: 16px 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #1d4ed8;
}

.alm-doc-section p,
.alm-doc-section li {
  font-size: 0.92rem;
  line-height: 1.85;
  color: #374151;
}

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

.alm-doc-section a { color: #1d4ed8; font-weight: 600; }

.alm-doc-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 16px;
}
.alm-doc-box ul { margin: 0; }
.alm-doc-box li:last-child { margin-bottom: 0; }

.alm-steps {
  counter-reset: alm-step;
  padding-left: 0;
  list-style: none;
}
.alm-steps li {
  counter-increment: alm-step;
  position: relative;
  padding-left: 2.4em;
  margin-bottom: 14px;
}
.alm-steps li::before {
  content: counter(alm-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7em;
  height: 1.7em;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.alm-faq-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.alm-faq-item h3 { margin: 0 0 6px; font-size: 1rem; color: #1d4ed8; }
.alm-faq-item p { margin: 0; }

.related-links {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.related-links li a {
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.875rem;
  background: #fff;
}
.related-links li a:hover { background: #eff6ff; }

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

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

  .alm-main-container { display: block; margin: 0; padding: 0; }

  .alm-section-card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .alm-paper-wrap { overflow: visible; }

  /* 画面上の表示倍率設定に関わらず、印刷は常に等倍で出力する */
  .alm-paper-stage {
    width: auto !important;
    height: auto !important;
  }

  .alm-paper-pages {
    transform: none !important;
    width: auto !important;
    gap: 0;
  }

  .alm-page {
    border: none;
    border-radius: 0;
    width: auto;
    min-height: 0;
    /* @pageのmarginがすでに紙端からの余白を確保するため、画面プレビュー用の
       paddingをここで打ち消す。打ち消さないと@page marginと二重に効いて
       しまい、実際の印刷が画面プレビューより余白が広くなってしまう。 */
    padding: 0;
    page-break-after: always;
  }

  .alm-page:last-child { page-break-after: auto; }

  .alm-print-table tr { page-break-inside: avoid; }

  @page {
    size: A4 portrait;
    margin: 12mm 8mm;
  }
}

/* ── 2026-08 推奨UI整理 ─────────────────────────────────────────── */
.alm-section-help {
  margin: -6px 0 14px;
  color: #64748b;
  font-size: 0.82rem;
}

.alm-sample-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 10px;
  color: #64748b;
  font-size: 0.8rem;
}

.alm-sample-action .alm-btn-text {
  font-size: 0.82rem;
}

.alm-list-header {
  justify-content: space-between;
  align-items: flex-start;
}

.alm-list-save-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.alm-list-save-meta .alm-save-status,
.alm-list-save-meta .alm-privacy-note {
  margin: 0;
}

.alm-data-tools {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e8edf3;
}

.alm-data-tools-head h3 {
  margin: 0 0 4px;
  color: #334155;
  font-size: 0.92rem;
}

.alm-data-tools-head p {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.alm-data-tools .alm-csv-toolbar {
  margin: 12px 0 0;
  padding: 0;
  border-bottom: 0;
}

.alm-preview-settings-basic {
  margin-bottom: 10px;
}

.alm-print-details {
  margin: 0 0 14px;
  border: 1px solid #e4e9f0;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.alm-print-details > summary {
  cursor: pointer;
  padding: 11px 14px;
  color: #2f6fb0;
  font-size: 0.85rem;
  font-weight: 600;
  list-style: none;
}

.alm-print-details > summary::-webkit-details-marker { display: none; }
.alm-print-details > summary::before { content: "▸ "; }
.alm-print-details[open] > summary::before { content: "▾ "; }

.alm-preview-settings-detail {
  margin: 0;
  border: 0;
  border-top: 1px solid #eef1f5;
  border-radius: 0;
}

.alm-preview-bottom-action {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.alm-preview-bottom-action .alm-btn {
  min-width: 220px;
}

@media (max-width: 767px) {
  .alm-list-save-meta {
    width: 100%;
    align-items: flex-start;
    text-align: left;
    margin-top: 2px;
  }

  .alm-bulk-toolbar {
    align-items: flex-start;
  }

  .alm-bulk-action-group {
    width: 100%;
  }

  .alm-preview-bottom-action .alm-btn {
    width: 100%;
  }
}

/* ── 2026-08 ファーストビュー改善 ─────────────────────────────────── */
.alm-seo-header {
  max-width: 980px;
  margin-bottom: 20px;
}

.alm-seo-lead {
  max-width: 780px;
  margin-bottom: 16px;
}

.alm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 24px;
  align-items: center;
  padding: 22px;
  margin: 0 0 12px;
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #f3f7fb 100%);
}

.alm-hero-copy {
  min-width: 0;
}

.alm-hero-eyebrow {
  margin: 0 0 14px;
  color: #1f4f8a;
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 700;
}

.alm-hero-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 18px;
  list-style: none;
}

.alm-hero-benefits li {
  position: relative;
  padding: 6px 10px 6px 26px;
  border: 1px solid #dbe7f3;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: .82rem;
  font-weight: 600;
}

.alm-hero-benefits li::before {
  content: "✓";
  position: absolute;
  left: 10px;
  color: #2f6fb0;
  font-weight: 700;
}

.alm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.alm-btn-lg {
  min-height: 46px;
  padding: 11px 18px;
  font-size: .92rem;
}

.alm-hero-note {
  margin: 0;
  color: #64748b;
  font-size: .78rem;
  line-height: 1.6;
}

.alm-mini-preview {
  min-width: 0;
}

.alm-mini-paper {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 18px 18px 16px;
  border: 1px solid #d7dee7;
  background: #fff;
  box-shadow: 0 8px 22px rgba(51, 65, 85, .08);
}

.alm-mini-title {
  padding-bottom: 10px;
  margin-bottom: 2px;
  border-bottom: 2px solid #334155;
  color: #111827;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

.alm-mini-row {
  display: grid;
  grid-template-columns: minmax(105px, .8fr) minmax(0, 1.5fr);
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid #e5e7eb;
}

.alm-mini-row:last-child {
  border-bottom: 0;
}

.alm-mini-row b,
.alm-mini-row span {
  display: block;
}

.alm-mini-row b {
  color: #111827;
  font-size: .8rem;
}

.alm-mini-row span {
  margin-top: 2px;
  color: #6b7280;
  font-size: .64rem;
}

.alm-mini-row p {
  margin: 0;
  color: #374151;
  font-size: .68rem;
  line-height: 1.55;
}

.alm-mini-caption {
  margin: 6px 0 0;
  color: #64748b;
  text-align: center;
  font-size: .72rem;
}

.alm-quick-flow {
  justify-content: center;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: .78rem;
}

.alm-quick-flow li:not([aria-hidden="true"]) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.alm-quick-flow li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eaf2fb;
  color: #2f6fb0;
  font-size: .7rem;
  font-weight: 700;
}

.alm-main-container {
  max-width: 980px;
}

.alm-form-card {
  position: relative;
  border-top: 4px solid #2f6fb0;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .07);
}

.alm-form-block {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  background: #fbfcfe;
}

.alm-form-block-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.alm-form-block-head h3 {
  margin: 0;
  color: #334155;
  font-size: .92rem;
  font-weight: 700;
}

.alm-form-block-head p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: .76rem;
}

.alm-form-block-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eaf2fb;
  color: #2f6fb0;
  font-size: .72rem;
  font-weight: 700;
}

.alm-address-group.alm-form-block {
  padding: 12px 14px 2px;
  border-color: #e8edf3;
  background: #fbfcfe;
}

.alm-address-group.alm-form-block legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  color: #334155;
  font-size: .92rem;
}

.alm-list-card {
  box-shadow: none;
  border-color: #dfe6ee;
}

.alm-preview-card {
  border-color: #d7e0ea;
  background: #f7f9fc;
  box-shadow: none;
}

.alm-preview-card .alm-preview-toolbar,
.alm-preview-card .alm-preview-settings,
.alm-preview-card .alm-print-details,
.alm-preview-card .alm-preview-bottom-action,
.alm-preview-card .alm-danger-zone {
  position: relative;
  z-index: 1;
}

.alm-preview-card .alm-paper-wrap {
  padding: 18px;
  border: 1px solid #e1e7ee;
  border-radius: 10px;
  background: #e9eef4;
}

@media (max-width: 760px) {
  .alm-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .alm-mini-preview {
    order: -1;
  }

  .alm-mini-paper {
    max-width: 440px;
  }

  .alm-hero-copy {
    text-align: center;
  }

  .alm-hero-benefits,
  .alm-hero-actions {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .alm-seo-header h1 {
    font-size: 1.35rem;
  }

  .alm-seo-lead {
    font-size: .9rem;
    line-height: 1.7;
  }

  .alm-hero {
    margin-left: -4px;
    margin-right: -4px;
    padding: 14px;
  }

  .alm-mini-row {
    grid-template-columns: minmax(90px, .9fr) minmax(0, 1.6fr);
  }

  .alm-hero-actions .alm-btn {
    width: 100%;
  }

  .alm-quick-flow {
    gap: 4px 6px;
  }

  .alm-quick-flow li[aria-hidden="true"] {
    display: none;
  }

  .alm-form-block {
    padding: 12px;
  }
}
