﻿/*
 * Nudge HQ スタイルシート
 * Stripe / Vercel 風モダンデザイン（v0.27〜）
 */

/* ===== デザイントークン ===== */
:root {
  /* ブランド：紫（バイオレット系、独自ブランド色） */
  --brand-50: #faf5ff;
  --brand-100: #f3e8ff;
  --brand-200: #e9d5ff;
  --brand-500: #7c3aed;
  --brand-600: #6d28d9;
  --brand-700: #5b21b6;
  --brand-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  --brand-gradient-hover: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);

  /* ニュートラル（slate） */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* セマンティック */
  --success:    #10b981;
  --success-bg: #ecfdf5;
  --success-border: #6ee7b7;
  --warning:    #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --danger:     #ef4444;
  --danger-bg:  #fef2f2;
  --danger-border: #fca5a5;
  --info-bg:    #eff6ff;
  --info-border: #93c5fd;

  /* レイアウト */
  --bg-page:        #fafafd;
  --bg-card:        #ffffff;
  --border-subtle:  #eef0f4;
  --border-default: #e2e8f0;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #94a3b8;

  /* 影（複層で柔らかい立体感） */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 8px -2px rgba(15,23,42,0.06), 0 2px 4px -2px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 24px -6px rgba(15,23,42,0.10), 0 4px 8px -4px rgba(15,23,42,0.04);
  --shadow-brand: 0 4px 12px -2px rgba(124,58,237,0.25);

  /* 角丸 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* アニメーション */
  --t-fast: 120ms ease;
  --t-base: 180ms ease;
}

/* ===== ベース ===== */
* { box-sizing: border-box; }
html {
  /* アンカーリンク（#pricing 等）クリック時のスクロールを滑らかに */
  scroll-behavior: smooth;
}
html, body {
  margin: 0; padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--brand-100); color: var(--brand-700); }
a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== トップバー（半透明 + ぼかし） ===== */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  flex-wrap: wrap; gap: 12px;
}
.logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo:hover { text-decoration: none; opacity: 0.85; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover {
  background: var(--slate-100);
  color: var(--slate-900);
  text-decoration: none;
}
.nav a.logout { color: #b91c1c; }
.nav a.logout:hover { background: var(--danger-bg); color: #991b1b; }
/* 新規登録など紫背景ボタンは白文字（.nav a の色指定に上書きされる対策。デスクトップ/モバイル共通） */
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }

/* ハンバーガーボタン（モバイルのみ表示。デスクトップでは隠す） */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--slate-700);
  box-shadow: none;
  flex-shrink: 0;
}
.nav-toggle:active { transform: none; }
.nav-toggle [data-lucide] { width: 22px; height: 22px; }
.nav-toggle .nav-toggle-close { display: none; }
.topbar-inner.nav-open .nav-toggle .nav-toggle-open { display: none; }
.topbar-inner.nav-open .nav-toggle .nav-toggle-close { display: inline-block; }

/* ===== ナビ・ドロップダウン（設定メニュー） ===== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: background var(--t-fast), color var(--t-fast);
  box-shadow: none;
}
.nav-dropdown-toggle:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}
.nav-dropdown-toggle [data-lucide] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.nav-dropdown-chevron {
  width: 13px !important;
  height: 13px !important;
  transition: transform var(--t-fast);
  margin-left: 2px;
  opacity: 0.7;
}
.nav-dropdown.is-open .nav-dropdown-chevron {
  transform: rotate(180deg);
}
.nav-dropdown.is-open .nav-dropdown-toggle {
  background: var(--slate-100);
  color: var(--slate-900);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  /* v0.99.9: 項目が多い（admin等）と画面外に見切れるため、ビューポート内に収めてスクロール */
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--slate-700);
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--t-fast);
}
.nav-dropdown-menu a:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  text-decoration: none;
}
.nav-dropdown-menu a [data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--slate-400);
  flex-shrink: 0;
}
.nav-dropdown-menu a:hover [data-lucide] {
  color: var(--brand-500);
}
.nav-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 4px;
}
/* v0.99.22: 設定ドロップダウンのグループ見出し */
.nav-dropdown-label {
  padding: 6px 12px 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--slate-400);
  text-transform: none;
  cursor: default;
}
.nav-dropdown-tag {
  margin-left: auto;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* スマホ：ドロップダウンを全幅で開く */
@media (max-width: 640px) {
  .nav-dropdown-menu {
    right: auto;
    left: 0;
    min-width: 200px;
  }
}

/* ===== 埋め込みモード（iframe 内の compose 用） ===== */
body.embed-body {
  background: #fff;
}
body.embed-body main.container {
  padding-top: 20px;
  padding-bottom: 40px;
  max-width: none;
}

/* ===== ステータスタブ（送信ワーク用） ===== */
.send-status-tabs {
  display: flex;
  gap: 4px;
  background: var(--slate-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.send-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-600);
  transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none;
}
.send-status-tab:hover {
  background: #fff;
  color: var(--slate-900);
  text-decoration: none;
}
.send-status-tab.is-active {
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}
.send-status-tab [data-lucide] {
  width: 15px;
  height: 15px;
  color: var(--slate-400);
}
.send-status-tab.is-active [data-lucide] {
  color: var(--brand-500);
}
.send-status-tab .tab-count {
  background: var(--slate-200);
  color: var(--slate-700);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.send-status-tab.is-active .tab-count {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* ===== スライドインパネル（送信ワーク → compose iframe） ===== */
.slide-panel {
  position: fixed;
  inset: 0;
  z-index: 800;
}
.slide-panel[hidden] {
  display: none;
}
.slide-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.slide-panel.is-open .slide-panel-backdrop {
  opacity: 1;
}
.slide-panel-sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(960px, 78vw);
  background: #fff;
  box-shadow: -8px 0 32px -8px rgba(15,23,42,0.18), -2px 0 8px -2px rgba(15,23,42,0.06);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.slide-panel.is-open .slide-panel-sheet {
  transform: translateX(0);
}
.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: #fff;
  flex-shrink: 0;
}
.slide-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}
.slide-panel-title [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--brand-500);
}
.slide-panel-sheet iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #fafafd;
}

/* スマホ：パネルを全幅 */
@media (max-width: 640px) {
  .slide-panel-sheet {
    width: 100%;
  }
}

/* ===== 折りたたみツールカード（リスト整備ツール用） ===== */
.tool-card {
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.tool-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--t-fast);
}
.tool-card > summary::-webkit-details-marker { display: none; }
.tool-card > summary:hover {
  background: var(--slate-50);
}
.tool-card > summary > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tool-card > summary > span:first-child [data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--brand-500);
}
.tool-card > summary::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--slate-400);
  border-bottom: 2px solid var(--slate-400);
  transform: rotate(45deg);
  transition: transform var(--t-base);
  margin-left: auto;
  flex-shrink: 0;
}
.tool-card[open] > summary::after {
  transform: rotate(-135deg);
}
.tool-card[open] > summary {
  border-bottom: 1px solid var(--border-subtle);
}
.tool-body {
  padding: 20px;
}
.tool-body p:first-child {
  margin-top: 0;
}

/* ===== レイアウト ===== */
main.container { padding-top: 32px; padding-bottom: 80px; }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
h1 {
  font-size: 28px; font-weight: 700; margin: 0 0 18px;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
h2 {
  font-size: 20px; font-weight: 700; margin: 28px 0 14px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
h3 {
  font-size: 16px; font-weight: 600; margin: 18px 0 8px;
  color: var(--text-primary);
}

/* ===== カード ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }
.warning-card {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

/* ===== フォーム ===== */
/* ===== モダン フォーム ベース（全画面に適用） ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="tel"],
input[type="search"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-sizing: border-box;
  max-width: 100%;
}
textarea {
  resize: vertical;
  min-height: 96px;
  width: 100%;
  display: block;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select {
  width: 100%;
  display: block;
}
input[type="date"],
input[type="datetime-local"] {
  /* v0.57.2: 他の入力欄と同じ block 扱いに。以前は width:auto かつ display 未指定で
     インラインのままラベル文字の右隣に並び、select（block）と高さがズレていた。 */
  display: block;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.18);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--slate-100);
  color: var(--text-tertiary);
  cursor: not-allowed;
}
/* チェックボックス・ラジオはデフォルトサイズ維持 */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  display: inline;
  margin-right: 6px;
}
/* ラベル：上にラベル → 下にフィールド、間隔ゆったり */
.card label,
.form label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}
.card label > input,
.card label > textarea,
.card label > select,
.form label > input,
.form label > textarea,
.form label > select {
  margin-top: 6px;
}

.form label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  color: #374151;
}
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form select,
.form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  font-family: inherit;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form fieldset {
  border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 16px; margin: 14px 0;
}
.form fieldset legend { padding: 0 6px; font-weight: 600; color: #374151; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 180px; }
.checkbox, .radio {
  display: inline-flex !important; align-items: center; gap: 6px;
  margin-right: 12px;
}
.checkbox input, .radio input { margin-right: 4px; }
.checkbox.big { font-size: 16px; padding: 12px; background: #fffbeb; border-radius: 6px; }

/* ===== ボタン ===== */
button, .btn-primary, .btn-secondary, .btn-danger {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  letter-spacing: -0.005em;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
button:active, .btn-primary:active, .btn-secondary:active, .btn-danger:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--brand-gradient-hover);
  text-decoration: none;
  box-shadow: 0 6px 16px -2px rgba(124,58,237,0.35);
}
.btn-primary:disabled {
  background: var(--slate-300);
  color: var(--slate-500);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  color: var(--slate-700);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--slate-50);
  text-decoration: none;
  border-color: var(--slate-300);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(239,68,68,0.35);
}
.btn-danger:hover {
  background: #dc2626;
  text-decoration: none;
}
.btn-danger:disabled { background: #fca5a5; cursor: not-allowed; }
.small { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.big { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.block { display: block; width: 100%; }
.inline { display: inline-block; margin: 0; }

/* ===== テーブル ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  font-size: 14px;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}
.data-table th {
  background: var(--slate-50);
  font-weight: 600;
  color: var(--slate-700);
  font-size: 13px;
  letter-spacing: 0.01em;
  text-transform: none;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--slate-50); }
.table-scroll {
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-scroll .data-table {
  box-shadow: none;
  border-radius: 0;
}

/* ===== コンタクト一覧テーブル専用：7列に縮約して画面内に収める ===== */
.contact-table {
  width: 100%;
  table-layout: auto;
  /* sticky を機能させるため separate に上書き（collapse は Chromium で sticky を壊す） */
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.contact-table th,
.contact-table td {
  white-space: nowrap;
  vertical-align: top;
  /* v0.55: 横幅圧縮のため余白を詰める（見切れ対策＝そもそも横スクロール不要に） */
  padding: 8px 10px;
  /* separate にしたので border-bottom を個別指定して collapse 時と同じ見た目に */
  border-bottom: 1px solid #f1f5f9;
}
/* v0.55: メール列は省略表示でぎゅっと（全文はツールチップ title で確認） */
.contact-table td.cell-email,
.contact-table th.cell-email {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-table tr:last-child td {
  border-bottom: none;
}
/* 会社名・メモ・備考は折り返し可（読みやすさ優先） */
.contact-table td.cell-wrap,
.contact-table th.cell-wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 280px;
}
.contact-table td.cell-action {
  white-space: normal;
  min-width: 200px;
  max-width: 240px;
}
/* 操作列のレイアウト：flex で折り返し、ボタンを2段構成に */
.contact-table td.cell-action {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.contact-table td.cell-action form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
/* メール作成ボタンは1段目で目立つように幅100% */
.contact-table td.cell-action > a.btn-primary {
  flex: 1 1 100%;
  text-align: center;
  margin-bottom: 2px;
}
/* 補助ボタン群は小さく */
.contact-table td.cell-action .btn-secondary.small,
.contact-table td.cell-action .btn-danger.small {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.3;
  /* v0.55.1: 「更新」が細い枠で 2 行（更/新）に折り返して縦長になり、
     他ボタンと高さが揃わない問題を修正。1 行固定＋縮小しない。 */
  white-space: nowrap;
  flex-shrink: 0;
}
.contact-table td.cell-action select {
  font-size: 11px;
  padding: 2px 4px;
  max-width: 80px;
}

/* ===== 操作列を右端固定（横スクロールしても常に見える） ===== */
.contact-table th.col-sticky-right,
.contact-table td.col-sticky-right {
  position: sticky !important;
  right: 0 !important;
  background: #fff;
  box-shadow: -6px 0 10px -4px rgba(0, 0, 0, 0.12);
  z-index: 5;
}
.contact-table th.col-sticky-right {
  background: #f9fafb;
  z-index: 6;
}
/* 行ホバー時も sticky セルの背景色を統一 */
.contact-table tbody tr:hover td.col-sticky-right {
  background: #f9fafb;
}
.contact-table .stage-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* ===== v0.56: 個別操作後の強制リロードで、触っていた行へ自動スクロール＆ハイライト ===== */
/* アンカー(#contact-row-<id>)で戻ってきたとき、固定ナビの下に隠れないようオフセット */
.contact-row {
  scroll-margin-top: 90px;
}
/* 戻ってきた行を約2秒ハイライトして「どの企業を触っていたか」を明示 */
.contact-row:target > td {
  animation: rowHighlight 2.2s ease-out;
}
@keyframes rowHighlight {
  0%   { background: #ede9fe; }
  70%  { background: #ede9fe; }
  100% { background: transparent; }
}
.contact-table th { font-size: 13px; }
.kv-table th { width: 120px; background: #f9fafb; text-align: right; padding-right: 16px; }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td { padding: 8px; border-bottom: 1px solid #f1f5f9; }

/* ===== バッジ ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--slate-100);
  color: var(--slate-700);
  letter-spacing: 0.01em;
}
.badge-blue  { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: var(--success-bg); color: #047857; }
.badge-red   { background: var(--danger-bg); color: #b91c1c; }
.badge-gray  { background: var(--slate-100); color: var(--slate-600); }
.badge-orange { background: #fff7ed; color: #c2410c; }
.row-warn    { background: var(--danger-bg); }

/* ===== フラッシュメッセージ（左ボーダーアクセント） ===== */
.flash-area { margin-bottom: 18px; }
.flash {
  padding: 12px 16px 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--slate-400);
  box-shadow: var(--shadow-xs);
}
.flash-success { border-left-color: var(--success); color: #065f46; background: var(--success-bg); }
.flash-error   { border-left-color: var(--danger);  color: #991b1b; background: var(--danger-bg);  }
.flash-warning { border-left-color: var(--warning); color: #92400e; background: var(--warning-bg); }

/* ===== メトリクス（ホバーで浮く） ===== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.metric-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.metric-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.metric-value {
  font-size: 34px;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 8px 0 4px;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.metric-sub { color: var(--text-secondary); font-weight: 600; font-size: 13px; }

/* ===== マッピング画面 ===== */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.required { color: #dc2626; font-size: 12px; }

/* ===== A/B 生成画面 ===== */
.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ab-card {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}
@media (max-width: 768px) {
  .ab-grid { grid-template-columns: 1fr; }
}

/* ===== 料金プラン ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.pricing-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card.highlight {
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}
.badge-best {
  position: absolute; top: -10px; right: 16px;
  background: #2563eb; color: #fff;
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
}
.price { font-size: 32px; font-weight: 700; margin: 14px 0 4px; }
.price small { font-size: 14px; color: #6b7280; font-weight: 400; }
.price-yearly { margin-bottom: 14px; }
.features { list-style: none; padding: 0; margin: 0 0 18px; flex-grow: 1; }
.features li {
  padding: 6px 0; padding-left: 22px;
  position: relative; font-size: 14px;
}
.features li::before {
  content: "✓"; color: #10b981; position: absolute; left: 0; font-weight: 700;
}

/* 月額/年額 切替トグル */
.cycle-toggle {
  display: flex;
  gap: 6px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
  margin: 12px 0 14px;
}
.cycle-opt {
  flex: 1;
  cursor: pointer;
  text-align: center;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 14px;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.cycle-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cycle-opt:has(input:checked) {
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.cycle-save-hint {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

/* 年額モード用 */
.price-block { min-height: 92px; }
.price-strike {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 15px;
  margin-bottom: 2px;
}
.price-strike small { font-size: 12px; color: #9ca3af; }
.discount-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* CTA は常にカード下端 */
.pricing-cta { margin-top: auto; }

/* ===== 共通 ===== */
.muted { color: #6b7280; }
.small { font-size: 12px; }
.snippet {
  white-space: pre-wrap;
  font-family: inherit;
  background: #f9fafb;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 8px 0 0;
  font-size: 13px;
  max-height: 240px;
  overflow: auto;
}
.mail-body {
  white-space: pre-wrap;
  font-family: inherit;
  background: #f9fafb;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
}
.filter-row {
  display: flex; gap: 12px; align-items: end;
  margin-bottom: 18px; flex-wrap: wrap;
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.filter-row label { display: flex; flex-direction: column; font-size: 13px; }
.filter-row select, .filter-row input {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  margin-top: 4px;
}

.progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar {
  height: 100%;
  background: #2563eb;
  transition: width 0.3s;
}

/* インディターミネート（完了数0%でも動いてる感を出すストライプアニメーション） */
.progress-bar.indeterminate {
  width: 100% !important;
  background: repeating-linear-gradient(
    45deg,
    #2563eb,
    #2563eb 10px,
    #60a5fa 10px,
    #60a5fa 20px
  );
  background-size: 28px 28px;
  animation: progress-stripes 1s linear infinite;
}
@keyframes progress-stripes {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}

/* v0.61: ロード中はトラック（未完了部分）にも床屋クルクルを流す＝「動いてる感」。
   塗り(.progress-bar)が左から覆い、未完了の右側だけにグレーのストライプが流れて見える。
   NudgeProgress.start/end が .progress に is-loading を付け外しする（全ロードバー共通）。 */
.progress.is-loading {
  background-color: #e5e7eb;
  background-image: repeating-linear-gradient(
    45deg,
    #e5e7eb,
    #e5e7eb 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
  background-size: 28px 28px;
  animation: progress-stripes 1s linear infinite;
}

/* ===== 使用量ウィジェット ===== */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.usage-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
}
.usage-card.near {
  background: #fffbeb;
  border-color: #fcd34d;
}
.usage-card.over {
  background: #fef2f2;
  border-color: #fca5a5;
}
.usage-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}
.usage-value {
  font-size: 18px;
  color: #1f2937;
}
.usage-value strong {
  font-size: 24px;
  font-weight: 700;
}
.usage-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* ===== AI 学習ステータス ===== */
.learning-card {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border-color: #c4b5fd;
}
.learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.learning-item {
  background: #ffffff;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  padding: 14px;
}
.learning-label {
  font-size: 12px;
  color: #6d28d9;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.learning-value {
  font-size: 16px;
  color: #1f2937;
  margin-bottom: 4px;
}
.level-stars {
  font-size: 22px;
  color: #f59e0b;
  letter-spacing: 2px;
  margin: 4px 0;
}

/* ===== v0.60: プレステージ・バッジ（CoD風・金グラデ） ===== */
.prestige-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #7a4f01;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 55%, #d97706 100%);
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid #f59e0b;
  letter-spacing: 0.02em;
}
.prestige-badge-lg {
  font-size: 14px;
  padding: 4px 14px;
  margin: 2px 0 6px;
}

/* ===== キャラクターカード ===== */
.character-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 18px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.character-card.character-happy   { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-color: #6ee7b7; }
.character-card.character-excited { background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: #fcd34d; }
.character-card.character-warning { background: linear-gradient(135deg, #fffbeb, #fde68a); border-color: #f59e0b; }
.character-card.character-stop    { background: linear-gradient(135deg, #fef2f2, #fecaca); border-color: #fca5a5; }
.character-card.character-sad     { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); border-color: #94a3b8; }
.character-card.character-lonely  { background: linear-gradient(135deg, #fdf2f8, #fce7f3); border-color: #f9a8d4; }
.character-card.character-neutral { background: linear-gradient(135deg, #eff6ff, #dbeafe); border-color: #93c5fd; }
.character-icon {
  font-size: 38px; line-height: 1;
}
.character-text { flex: 1; }

/* ===== アップグレードバナー（グローバル） ===== */
.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  flex-wrap: wrap;
}
.upgrade-banner.upgrade-warning {
  background: #fffbeb; border: 1px solid #fcd34d; color: #92400e;
}
.upgrade-banner.upgrade-danger {
  background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b;
}

/* ===== トライアルカード ===== */
.trial-card.trial-warn { border-color: #fcd34d; background: #fffbeb; }
.trial-card.trial-danger { border-color: #fca5a5; background: #fef2f2; }

/* ===== 業種別学習メーター ===== */
.meter-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.meter-row {
  display: grid;
  grid-template-columns: 1fr 200px 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: #f9fafb;
  border-radius: 6px;
}
.meter-bar-wrap {
  background: #e5e7eb;
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}
.meter-bar {
  height: 100%;
  transition: width 0.4s;
  border-radius: 999px;
}
.meter-value { text-align: right; }
@media (max-width: 640px) {
  .meter-row { grid-template-columns: 1fr; }
  .meter-value { text-align: left; }
}

/* ===== フッター ===== */
.footer {
  background: #fff;
  border-top: 1px solid var(--border-subtle);
  padding: 28px 0 32px;
  margin-top: 60px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 13px;
}
.footer small { margin: 0 8px; }
.footer a { color: var(--slate-600); font-weight: 500; }
.footer a:hover { color: var(--brand-600); }
.version-badge {
  display: inline-block;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.version-badge a { color: var(--brand-700); font-weight: 600; }
.version-badge a:hover { text-decoration: none; }

/* ===== レスポンシブ（スマホ） =====
   ※ topbar / nav のモバイル対応はファイル末尾「モバイル土台（v0.67〜）」に集約。 */
@media (max-width: 640px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 24px; }
  .data-table { font-size: 13px; }
  .row { flex-direction: column; }
}

/* ===== ランディングページ ===== */
.btn-lg {
  padding: 14px 32px;
  font-size: 17px;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
}
.lp-hero {
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  padding: 80px 20px 100px;
  text-align: center;
  margin: -20px -20px 0;
}
.lp-hero-inner { max-width: 900px; margin: 0 auto; }
.lp-hero-title {
  font-size: 56px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 24px;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.lp-gradient {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-hero-sub {
  font-size: 19px;
  line-height: 1.7;
  color: #475569;
  margin: 0 0 36px;
  word-break: keep-all; /* CJKを語句単位で改行（<wbr>位置でのみ折り返す。中途半端な途中改行を防ぐ） */
}
.lp-hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.lp-section { padding: 80px 20px; }
.lp-bg-gray { background: #f9fafb; margin: 0 -20px; padding-left: 40px; padding-right: 40px; }
.lp-narrow { max-width: 1100px; margin: 0 auto; }
.lp-section-title {
  font-size: 36px;
  text-align: center;
  font-weight: 800;
  margin: 0 0 16px;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.lp-section-sub {
  text-align: center;
  color: #64748b;
  font-size: 17px;
  margin: 0 0 48px;
}

/* 課題提起グリッド */
.lp-pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.lp-pain {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
}
.lp-pain-icon { margin-bottom: 12px; color: #7B2FBE; line-height: 0; }
.lp-pain-icon svg, .lp-pain-icon [data-lucide] { width: 34px; height: 34px; }
.lp-pain p { color: #374151; margin: 0; line-height: 1.6; }

/* 機能グリッド */
.lp-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.lp-feature {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.lp-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.lp-feature-icon { margin-bottom: 16px; color: #7B2FBE; line-height: 0; }
.lp-feature-icon svg, .lp-feature-icon [data-lucide] { width: 40px; height: 40px; }
.lp-feature h3 { margin: 0 0 12px; font-size: 20px; color: #0f172a; }
.lp-feature p { color: #475569; line-height: 1.7; margin: 0; }

/* ステップ */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.lp-step {
  text-align: center;
  padding: 28px;
}
.lp-step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.lp-step h3 { font-size: 22px; margin: 0 0 12px; color: #0f172a; }
.lp-step p { color: #475569; line-height: 1.7; margin: 0; }

/* 料金抜粋 */
.lp-pricing-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 48px;
}
@media (max-width: 980px) {
  .lp-pricing-mini { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 540px) {
  .lp-pricing-mini { grid-template-columns: 1fr; }
}
.lp-pricing-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  position: relative;
}
.lp-pricing-card.lp-highlight {
  border-color: #2563eb;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.18);
}
.lp-pricing-card h3 { margin: 0 0 16px; font-size: 22px; color: #0f172a; }
.lp-price {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}
.lp-price small { font-size: 16px; font-weight: 500; color: #64748b; }
.lp-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #fff;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* v0.96: 2大コスト優位（初期費用0 / ユーザー追加0円） */
.lp-cost-badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}
@media (max-width: 540px) { .lp-cost-badges { grid-template-columns: 1fr; } }
.lp-cost-badge {
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1px solid var(--brand-200);
  border-radius: 14px;
  padding: 22px 24px;
  text-align: center;
}
.lp-cost-zero { font-size: 24px; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.lp-cost-zero span { font-size: 46px; color: #7c3aed; margin: 0 2px; vertical-align: -3px; }
.lp-cost-zero small { font-size: 20px; font-weight: 700; color: #7c3aed; }
.lp-cost-badge p { margin: 0; font-size: 14px; color: #475569; line-height: 1.7; }

/* v0.96: Light主役の2カード（上位プランは資料DLへ誘導） */
.lp-pricing-mini.lp-pricing-duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 540px) { .lp-pricing-mini.lp-pricing-duo { grid-template-columns: 1fr; } }
.lp-plan-points {
  list-style: none; padding: 0; margin: 18px auto 0; text-align: left; display: inline-block;
}
.lp-plan-points li { position: relative; padding-left: 26px; margin: 8px 0; font-size: 14px; color: #334155; }
.lp-plan-points li::before { content: "✓"; position: absolute; left: 4px; color: #10b981; font-weight: 800; }
.lp-plan-more {
  background: #fbfaff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.lp-plan-more p { margin: 0 0 4px; font-size: 14px; color: #475569; line-height: 1.7; }
.lp-plan-more .lp-cta-sub { margin-top: 10px; max-width: 280px; }
.lp-plan-more .lp-cta-sub i { width: 16px; height: 16px; vertical-align: -3px; }

/* FAQ */
.lp-faq { max-width: 800px; margin: 48px auto 0; }
.lp-faq-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 20px 24px;
  cursor: pointer;
}
.lp-faq-item summary {
  font-weight: 600;
  color: #0f172a;
  font-size: 16px;
  outline: none;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.lp-faq-item summary::-webkit-details-marker { display: none; }
.lp-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 24px;
  color: #2563eb;
  transition: transform 0.2s;
}
.lp-faq-item[open] summary::after { transform: rotate(45deg); }
.lp-faq-item p { color: #475569; line-height: 1.7; margin: 12px 0 0; }

/* 最終CTA */
.lp-cta-final {
  background: linear-gradient(135deg, #1e40af 0%, #6d28d9 100%);
  margin: 0 -20px;
  padding-left: 40px;
  padding-right: 40px;
}

/* 法務ページ用 */
.legal-page {
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 48px;
}
.legal-page h1 { font-size: 28px; margin: 0 0 8px; color: #0f172a; }
.legal-page .legal-updated { color: #6b7280; font-size: 13px; margin-bottom: 32px; }
.legal-page h2 { font-size: 20px; margin: 32px 0 12px; color: #1e293b; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.legal-page h3 { font-size: 16px; margin: 20px 0 8px; color: #334155; }
.legal-page p, .legal-page li { line-height: 1.8; color: #374151; }
.legal-page ul, .legal-page ol { padding-left: 24px; }
.legal-page table.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.legal-page table.legal-table th,
.legal-page table.legal-table td {
  border: 1px solid #e5e7eb;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}
.legal-page table.legal-table th {
  background: #f9fafb;
  width: 200px;
  font-weight: 600;
}
.legal-placeholder {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== マイクロインタラクション ===== */

/* Lucide アイコン共通スタイル */
[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  display: inline-block;
  vertical-align: -3px;
}
/* ナビ内アイコンとテキストの間隔 */
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav a [data-lucide] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ボタン内アイコン */
.btn-primary [data-lucide],
.btn-secondary [data-lucide],
.btn-danger [data-lucide],
button [data-lucide] {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
}

/* スピナー（円が回転） */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
  opacity: 0.8;
}
.btn-loading-text { font-weight: 600; }
button.is-loading,
.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-danger.is-loading {
  cursor: wait;
  opacity: 0.85;
}

/* リンクのナビゲーション中（.nav-loading クラス） */
a.nav-loading.is-loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}
a.nav-loading.is-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 6px;
  vertical-align: -2px;
}

/* ページ読み込み時のフェードイン */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
main.container > * {
  /* v0.55: fill-mode を both→backwards に変更。both だとアニメ完了後も
     transform: translateY(0) が残り、子孫の position: sticky（操作列の右端固定）が
     壊れてテーブル右側が見切れる原因になっていた。backwards なら遅延中の初期状態は
     維持しつつ、完了後は base（transform:none）に戻るので sticky が正しく効く。 */
  animation: fadeInUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
main.container > *:nth-child(2) { animation-delay: 0.04s; }
main.container > *:nth-child(3) { animation-delay: 0.08s; }
main.container > *:nth-child(4) { animation-delay: 0.12s; }

/* フラッシュメッセージのスライドイン */
@keyframes slideInFromTop {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flash {
  animation: slideInFromTop 0.3s ease-out both;
}

/* カードのホバー浮き上がり（オプション、過剰演出を避けるため card.interactive のみに適用） */
.card.interactive {
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.card.interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* スケルトン（データ読み込み中のプレースホルダー） */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--slate-100) 25%,
    var(--slate-200) 50%,
    var(--slate-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
}
.skeleton-line { height: 14px; margin: 6px 0; }
.skeleton-line.lg { height: 22px; }
.skeleton-line.sm { height: 11px; }

/* ページ全体のローディングオーバーレイ（フォーム送信後にスピナー表示用） */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.page-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.page-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* テーブル行のクリック可能感（必要な箇所にだけ .clickable を付与） */
.data-table tbody tr.clickable {
  cursor: pointer;
}
.data-table tbody tr.clickable:hover {
  background: var(--brand-50);
}

/* ===== モーダル（カスタム確認ダイアログ） ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
/* HTML の hidden 属性を効かせる（display: flex に上書きされないように） */
.modal-overlay[hidden] {
  display: none;
}
.modal-overlay.is-visible {
  opacity: 1;
}
.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.is-visible .modal-dialog {
  transform: scale(1);
}
.modal-icon {
  width: 52px;
  height: 52px;
  background: var(--warning-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.modal-icon [data-lucide] {
  width: 26px;
  height: 26px;
  color: var(--warning);
  vertical-align: 0;
}
.modal-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-primary);
}
.modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions button {
  min-width: 110px;
}

/* ===== RPG風チュートリアル解説ポップアップ（v0.40〜） ===== */
.tutorial-intro-dialog {
  max-width: 540px;
  text-align: left;
  padding: 30px 30px 26px;
  border: 1px solid var(--brand-200);
  background:
    linear-gradient(180deg, #faf5ff 0%, #ffffff 120px);
}
.tutorial-intro-badge {
  display: inline-block;
  background: var(--brand-600, #7c3aed);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.tutorial-intro-emoji {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
}
.tutorial-intro-title {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--brand-700, #6d28d9);
  line-height: 1.4;
}
.tutorial-intro-body p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.85;
  margin: 0 0 12px;
}
.tutorial-intro-body p:last-child {
  margin-bottom: 0;
}
.tutorial-intro-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.tutorial-intro-actions .btn-primary {
  font-size: 15px;
  padding: 11px 22px;
}
body.tutorial-intro-open {
  overflow: hidden;
}
@media (max-width: 560px) {
  .tutorial-intro-actions { justify-content: stretch; }
  .tutorial-intro-actions button { flex: 1; min-width: 0; }
}

/* ===== 空状態 ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: #fff;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}
.empty-state-icon {
  width: 72px;
  height: 72px;
  background: var(--brand-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--brand-500);
}
.empty-state-icon [data-lucide] {
  width: 36px;
  height: 36px;
  vertical-align: 0;
  stroke-width: 1.5;
}
.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.empty-state-message {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 20px;
  line-height: 1.7;
}
.empty-state-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== ダッシュボード用グラフコンテナ ===== */
.chart-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.chart-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card h3 [data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--brand-500);
}
.chart-card .chart-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
}
.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 768px) {
  .chart-grid-2 { grid-template-columns: 1fr; }
}

/* レスポンシブ：LP */
@media (max-width: 640px) {
  .lp-hero { padding: 50px 20px 60px; }
  .lp-hero-title { font-size: 36px; }
  .lp-hero-sub { font-size: 16px; }
  .lp-br-pc { display: none; } /* PC用の文区切り改行はモバイルでは消し、<wbr>に任せる */
  .lp-section { padding: 50px 16px; }
  .lp-bg-gray, .lp-cta-final { margin: 0 -20px; padding-left: 24px; padding-right: 24px; }
  .lp-section-title { font-size: 26px; }
  .lp-pricing-card.lp-highlight { transform: none; }
  .legal-page { padding: 24px; margin: 20px 16px; }
}

/* ===== オンボーディング画面（v0.33〜） ===== */
.onboarding-header {
  max-width: 760px;
  margin: 24px auto 28px;
  padding: 0 8px;
}
.onboarding-header h1 {
  display: flex; align-items: center; gap: 10px;
  font-size: 28px;
}
.onboarding-header h1 [data-lucide] {
  width: 28px; height: 28px;
  color: var(--brand-600);
}

/* プログレスバー */
.onboarding-progress {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.onboarding-progress-track {
  width: 100%;
  height: 8px;
  background: var(--slate-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.onboarding-progress-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 999px;
  transition: width 400ms ease;
}
.onboarding-progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}

/* ステップカード */
.onboarding-step {
  max-width: 760px;
  margin: 0 auto 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.onboarding-step:hover { box-shadow: var(--shadow-sm); }
.onboarding-step.is-done {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.onboarding-step-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
}
.onboarding-step.is-done .onboarding-step-head { padding-bottom: 16px; }
.onboarding-step-num {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--slate-100);
  color: var(--text-secondary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.onboarding-step.is-done .onboarding-step-num {
  background: var(--success);
  color: white;
}
.onboarding-step.is-done .onboarding-step-num [data-lucide] {
  width: 18px; height: 18px;
}
.onboarding-step-title {
  flex: 1;
  font-size: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.onboarding-step-status { flex-shrink: 0; }

/* 必須/任意バッジ */
.onboarding-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.onboarding-badge.required {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.onboarding-badge.optional {
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--border-default);
}

/* ステップボディ（折りたたみ） */
.onboarding-step-body {
  display: none;
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
}
.onboarding-step-body.open { display: block; }
.onboarding-step.is-done .onboarding-step-body { border-top-color: var(--success-border); }

/* 必須印（赤*） */
.required-mark {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

/* ようこそステップ：トライアル特典カード */
.onboarding-step-welcome { background: linear-gradient(135deg, #faf5ff 0%, #f0e7ff 100%); border-color: var(--brand-200); }
.trial-perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.trial-perk {
  text-align: center;
  padding: 18px 12px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-200);
}
.trial-perk-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--brand-gradient);
  color: white;
  border-radius: 50%;
  margin-bottom: 10px;
}
.trial-perk-icon [data-lucide] { width: 22px; height: 22px; }
.trial-perk-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-700);
  margin-bottom: 4px;
}
.trial-perk-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.trial-note {
  background: white;
  border: 1px solid var(--info-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.trial-note [data-lucide] {
  width: 16px; height: 16px;
  color: var(--brand-600);
  vertical-align: -3px;
  margin-right: 4px;
}

/* 必須/任意 区切り */
.onboarding-divider {
  max-width: 760px;
  margin: 26px auto 14px;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  border-radius: var(--radius-md);
}
.onboarding-divider.muted {
  background: var(--slate-50);
  color: var(--text-secondary);
}
.onboarding-divider [data-lucide] {
  width: 16px; height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
}

/* 任意ステップの2カードCTA（最初のリストを作る） */
.onboarding-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.onboarding-cta-card {
  display: block;
  padding: 18px;
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-primary);
  transition: all var(--t-base);
}
.onboarding-cta-card:hover {
  border-color: var(--brand-500);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-2px);
}
.onboarding-cta-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: var(--brand-50);
  color: var(--brand-600);
  border-radius: 50%;
  margin-bottom: 10px;
}
.onboarding-cta-icon [data-lucide] { width: 22px; height: 22px; }
.onboarding-cta-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

/* フッター完了ボタン */
.onboarding-footer {
  max-width: 760px;
  margin: 28px auto 60px;
  padding: 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.btn-large {
  padding: 14px 28px;
  font-size: 16px;
}
.btn-primary[disabled] {
  background: var(--slate-200);
  color: var(--slate-500);
  cursor: not-allowed;
  box-shadow: none;
}
.onboarding-pending {
  display: inline-block;
  margin: 0 4px;
  padding: 2px 10px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* badge-success */
.badge.badge-success,
.badge-success {
  display: inline-block;
  padding: 3px 10px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* レスポンシブ */
@media (max-width: 640px) {
  .onboarding-header { padding: 0 16px; }
  .onboarding-step { margin-left: 12px; margin-right: 12px; }
  .onboarding-footer { margin-left: 12px; margin-right: 12px; }
  .trial-perks { grid-template-columns: 1fr; gap: 10px; }
  .onboarding-cta-grid { grid-template-columns: 1fr; }
  .onboarding-step-head { padding: 12px 14px; }
  .onboarding-step-body { padding: 14px; padding-top: 14px; }
}

/* ===== バックグラウンドジョブ進捗モーダル（v0.34〜） =====
   BulkJob 系の進捗UIを画面中央に固定表示し、背景操作を物理的にブロック
   beforeunload リスナーと組み合わせてページ離脱事故を防ぐ

   注意：backdrop-filter:blur() は Chromium 系でモーダル本体まで巻き込んで
   ぼかしてしまう副作用があるため使わない（v0.34.1 で削除）。
   背景を見えなくするには半透明の暗幕（rgba alpha）だけで十分。
*/
.progress-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1000;
  animation: progress-modal-fade-in 200ms ease-out;
}
.progress-modal-backdrop.is-visible {
  display: block;
}
@keyframes progress-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== v0.65: 同期処理用ロードオーバーレイ ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1100;
  animation: progress-modal-fade-in 180ms ease-out;
}
.loading-overlay.is-visible { display: flex; }
.loading-overlay-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.loading-overlay-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
  color: var(--text-primary);
}
body.loading-overlay-open { overflow: hidden; }

/* 既存の進捗 div に .progress-modal-active が付くと画面中央モーダルに昇格 */
.progress-modal-active {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  z-index: 1001 !important;
  max-width: 560px !important;
  width: calc(100% - 32px) !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  box-shadow: 0 24px 70px -10px rgba(15, 23, 42, 0.5), 0 8px 20px -6px rgba(15, 23, 42, 0.2) !important;
  border-radius: var(--radius-lg) !important;
  background: #ffffff !important;   /* ポップアップははっきり明るく（背景の暗がりと差をつける） */
  border: 1px solid #e5e7eb !important;
  padding: 20px !important;
  animation: progress-modal-pop-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes progress-modal-pop-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* モーダル表示中は body のスクロールを止める */
body.progress-modal-open {
  overflow: hidden;
}

/* モーダル内に「離脱不可」の案内バナーを表示するためのフッター */
.progress-modal-active::after {
  content: "⚠ ページを離れずにお待ちください。サーバー側の処理は中断されませんが、進捗が見えなくなります。";
  display: block;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

/* チュートリアル：本物のボタンの場所をハイライトするパルス（v0.39〜） */
@keyframes tutorialPulse {
  0%   { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(124, 58, 237, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}
.tutorial-pulse {
  animation: tutorialPulse 1.1s ease-out 3;
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md);
}

/* ===== LP 掲載メディア 流れるティッカー（v0.46〜） ===== */
.lp-media {
  padding: 32px 0 16px;
  overflow: hidden;
}
.lp-media-label {
  text-align: center;
  color: #6b7280;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  margin: 0 0 18px;
}
.media-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.media-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: media-scroll 50s linear infinite;
}
.media-marquee:hover .media-track {
  animation-play-state: paused;
}
.media-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 11px 20px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.lp-media-note {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  margin: 16px 0 0;
}
@keyframes media-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .media-track { animation: none; flex-wrap: wrap; justify-content: center; }
}

/* ==========================================================================
   モバイル土台（v0.67〜）
   営業マンが移動中（電車・車内）にスマホで完璧に使えるようにするための
   横断的なレスポンシブ改修。base.html / 全画面共通。
   ========================================================================== */

/* ----- ① ナビ：860px 以下でハンバーガーメニュー化 ----- */
@media (max-width: 860px) {
  .topbar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .nav-toggle { display: inline-flex; }

  /* ナビ本体：既定で隠し、nav-open で縦並び展開 */
  .nav {
    display: none;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    /* v0.93.1: ベース .nav の flex-wrap:wrap を必ず打ち消す。
       縦並び(column)のまま wrap が残ると、設定ドロップダウン展開で高さが max-height を
       超えたとき「2列目」に折り返し、設定とログアウトが画面右外へ消えてタップ不能になる。
       nowrap にして溢れた分は下の overflow-y:auto でスクロールさせる。 */
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
  }
  /* 縦1列のとき各項目が main 軸方向に潰れないように（メニューが長くてもスクロールで対応） */
  .topbar-inner.nav-open .nav > * { flex-shrink: 0; }
  .topbar-inner.nav-open .nav {
    display: flex;
    /* v0.87: メニューが長くても（admin多数）メニュー内部だけスクロール。背後の本体は動かさない */
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    /* v0.87.1: overflow-y:auto にすると overflow-x も auto になり横スクロール（横膨張）が出るため明示的に抑止 */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    padding-bottom: 24px;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }
  /* v0.87.1: ドロップダウン項目（長いadmin名＋タグ）は折り返して横にはみ出さない */
  .nav a, .nav-dropdown-toggle, .nav-dropdown-menu a {
    white-space: normal;
    word-break: break-word;
    min-width: 0;
  }
  /* v0.87: ナビ展開中は背後の本体スクロールをロック（背後が先にスクロールする不具合を解消） */
  body.nav-lock { overflow: hidden; }

  /* 各リンクを大きなタップ領域に */
  .nav a,
  .nav-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    padding: 12px 12px;
    min-height: 48px;
    border-radius: var(--radius-md);
  }
  .nav a [data-lucide],
  .nav-dropdown-toggle [data-lucide] {
    width: 18px; height: 18px; flex-shrink: 0;
  }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle { justify-content: flex-start; }
  .nav-dropdown-chevron { margin-left: auto; }

  /* 設定ドロップダウン：モバイルでは浮かせず、その場でインライン展開 */
  .nav-dropdown-menu {
    position: static;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--brand-100);
    border-radius: 0;
    margin: 2px 0 4px 6px;
    padding: 2px 0 2px 6px;
    transform: none;
    /* モバイルはナビ自体がスクロールするので、ドロップダウン側の高さ制限は解除（二重スクロール防止） */
    max-height: none;
    overflow-y: visible;
  }
  .nav-dropdown:not(.is-open) .nav-dropdown-menu { display: none; }
  .nav-dropdown.is-open .nav-dropdown-menu { transform: none; }
  .nav-dropdown-menu a { min-height: 46px; padding: 11px 12px; }
  .nav a.logout { margin-top: 4px; }
}

/* ----- ② タップ最適化 + iOSズーム防止（640px 以下） ----- */
@media (max-width: 640px) {
  /* iOS は font-size<16px の入力欄でフォーカス時に自動ズームする。16px で防止 */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
    padding: 12px 14px;
  }

  /* ボタンは指で押せる最小サイズ（44px）を確保 */
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  button[type="submit"] {
    min-height: 44px;
  }
  /* small "ボタン" は小さく保ちつつ押せるサイズに。
     ※ .small はテキスト（p.muted.small / badge.small 等）にも広く使われるため、
        ボタン/リンクだけに限定する（全 .small に inline-flex を当てると段落が崩れる）。 */
  a.small,
  button.small,
  .btn-primary.small,
  .btn-secondary.small,
  .btn-danger.small {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
  /* .block / full ボタンはそのまま全幅 */

  /* 余白を詰めて画面を広く使う */
  .container { padding: 0 14px; }
  main.container { padding-top: 18px; padding-bottom: 56px; }
  .card { padding: 16px; border-radius: var(--radius-md); }
  h1 { font-size: 23px; }
  h2 { font-size: 18px; }

  /* ページヘッダ：タイトルとアクションを縦積み、アクションは横スクロール無しで折り返し */
  .page-header > div { width: 100%; }

  /* ステータスタブ：折り返さず横スクロール（1行でスッキリ） */
  .send-status-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .send-status-tabs::-webkit-scrollbar { display: none; }
  .send-status-tab { flex-shrink: 0; }

  /* 絞り込みフォーム等：横並び label を縦に */
  form.card[style*="flex"] label,
  .row > label { min-width: 0 !important; flex-basis: 100% !important; }

  /* フラッシュ・バナーの中身を縦積みに（ボタンが見切れない） */
  .upgrade-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ----- ③ 汎用テーブル → カード化（640px 以下）-----
   .responsive-cards クラスを付けたテーブルは、スマホで「1行＝1カード」に化ける。
   各 <td> に data-label="見出し" を付けると「見出し：値」で表示。
   操作ボタンのセルは data-label を付けず、代わりに class="cell-action" を付けるとボタンが並ぶ。 */
@media (max-width: 640px) {
  table.responsive-cards,
  table.responsive-cards tbody {
    display: block;
    width: 100%;
    border: none;
  }
  table.responsive-cards thead { display: none; }
  table.responsive-cards tr {
    display: block;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  table.responsive-cards td {
    display: block;
    border: none !important;
    padding: 3px 0;
    white-space: normal !important;
    max-width: none !important;
    text-align: left !important;
    font-size: 14px;
  }
  table.responsive-cards td[data-label]::before {
    content: attr(data-label) "：";
    font-weight: 600;
    color: var(--slate-400);
    margin-right: 6px;
  }
  /* data-label の無い先頭セル＝カード見出し（会社名・リスト名など） */
  table.responsive-cards td:first-child:not([data-label]):not(.cell-action) {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  /* 操作セル：ボタンを横並び（はみ出さず折り返し） */
  table.responsive-cards td.cell-action {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: stretch;
  }
  table.responsive-cards td.cell-action::before { width: 100%; display: block; }
  table.responsive-cards td.cell-action .inline,
  table.responsive-cards td.cell-action form { margin: 0; }
  table.responsive-cards td.cell-action .btn-primary,
  table.responsive-cards td.cell-action .btn-secondary,
  table.responsive-cards td.cell-action .btn-danger { min-height: 42px; }
  /* details（本文を見る 等）はカード内で全幅 */
  table.responsive-cards td details { width: 100%; }
  table.responsive-cards td .snippet { white-space: pre-wrap; word-break: break-word; }
}

/* ----- ④ 送信ワークのカード化（最優先画面） ----- */
@media (max-width: 640px) {
  .send-work-table,
  .send-work-table tbody { display: block; width: 100%; border: none; }
  .send-work-table thead { display: none; }
  .send-work-table tr.send-row {
    display: block;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow var(--t-fast), border-color var(--t-fast);
  }
  .send-work-table tr.send-row:active {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
  }
  .send-work-table tr.send-row td {
    display: block;
    border: none !important;
    padding: 0;
    white-space: normal !important;
  }
  /* 会社名セル＝カード見出し */
  .send-work-table td.cell-company { margin-bottom: 8px; }
  .send-work-table td.cell-company strong { font-size: 16px; }
  /* 業種・エリア＝メタ行（横並び、ラベル付き） */
  .send-work-table td.cell-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 13px;
    color: var(--slate-600);
    margin-right: 14px;
    margin-bottom: 4px;
  }
  .send-work-table td.cell-meta::before {
    content: attr(data-label) "：";
    color: var(--slate-400);
    font-weight: 600;
  }
  /* 状態バッジ行 */
  .send-work-table td.cell-status { margin: 8px 0 10px; }
  /* 操作ボタン：全幅＋大きく */
  .send-work-table td.cell-action > div {
    display: flex;
    gap: 8px;
  }
  .send-work-table td.cell-action .open-compose {
    flex: 1;
    min-height: 46px;
    font-size: 15px;
  }
  .send-work-table td.cell-action form.inline button {
    min-height: 46px;
    min-width: 52px;
  }
}

/* ----- ⑤ スライドパネル（compose）：モバイルで下からシート風に ----- */
@media (max-width: 640px) {
  .slide-panel-sheet {
    width: 100%;
    /* iOS のセーフエリア（ホームバー）を避ける */
    padding-bottom: env(safe-area-inset-bottom);
  }
  .slide-panel-header { padding: 12px 14px; position: sticky; top: 0; z-index: 2; }
}

/* ----- ⑥ リスト（コンタクト一覧 .contact-table）のカード化 -----
   移動中のメイン画面。横スクロールの広いテーブルを 1社=1カードに。
   メイン行(tr.contact-row)＝カード、詳細行(tr.contact-detail-row)＝カード下のメモ/備考パネル。 */
@media (max-width: 640px) {
  .contact-table,
  .contact-table tbody { display: block; width: 100%; border: none; }
  .contact-table thead { display: none; }

  /* メイン行＝カード */
  .contact-table tr.contact-row {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  .contact-table tr.contact-row td {
    display: block;
    border: none !important;
    padding: 2px 0;
    white-space: normal !important;
    max-width: none !important;
  }

  /* チェックボックス＝カード右上に固定（一括選択用） */
  .contact-table td.cell-check {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0;
  }
  .contact-table td.cell-check input[type="checkbox"] {
    width: 22px; height: 22px;
  }

  /* 会社名＝カード見出し（右上チェックボックス分の余白を確保） */
  .contact-table td.cell-company {
    padding-right: 36px;
    margin-bottom: 6px;
  }
  .contact-table td.cell-company strong { font-size: 16px; }

  /* メール・業種エリア＝ラベル付きメタ行 */
  .contact-table td.cell-email,
  .contact-table td.cell-ia {
    font-size: 13px;
    color: var(--slate-600);
  }
  .contact-table td.cell-email::before,
  .contact-table td.cell-ia::before {
    content: attr(data-label) "：";
    color: var(--slate-400);
    font-weight: 600;
  }
  /* 業種・エリアは「業種・エリア：リフォーム / 東京都」の2行で表示。
     <br> はそのまま活かす（消すと「リフォーム東京都」と繋がって読めない）。 */

  /* 詳細バッジ行（クリックでメモ/備考パネル展開） */
  .contact-table td.cell-detail { margin: 8px 0; }
  .contact-table td.cell-detail::before { display: none; }
  .contact-table td.cell-detail .detail-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    width: 100%;
    min-height: 40px;
  }

  /* 状態バッジ行 */
  .contact-table td.cell-status { margin-bottom: 10px; }
  .contact-table td.cell-status::before { display: none; }

  /* 操作セル：右固定を解除し、ボタンを並べる（送信は全幅で目立たせる） */
  .contact-table td.cell-action.col-sticky-right {
    position: static;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
  }
  .contact-table td.cell-action > a.btn-primary {
    flex: 1 1 100%;
    min-height: 46px;
    font-size: 15px;
  }
  .contact-table td.cell-action form.inline { margin: 0; }
  .contact-table td.cell-action form.enrich-form { flex: 1 1 100%; }
  .contact-table td.cell-action form.enrich-form button { width: 100%; min-height: 42px; }
  /* 状態変更フォーム（select＋更新）は1行で */
  .contact-table td.cell-action form.inline:has(select) {
    flex: 1 1 100%;
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .contact-table td.cell-action form.inline select { flex: 1; }
  /* 削除・ブロックの小ボタンは横並び */
  .contact-table td.cell-action form.inline button { min-height: 42px; }

  /* 詳細（メモ・備考）行：カード直下に薄いパネルとして表示 */
  .contact-table tr.contact-detail-row { display: block; margin-top: -8px; margin-bottom: 12px; }
  .contact-table tr.contact-detail-row[hidden] { display: none; }
  .contact-table tr.contact-detail-row td {
    display: block;
    padding: 0 !important;
    background: #faf9ff !important;
    border: 1px solid var(--brand-100) !important;
    border-radius: var(--radius-md);
  }
  .contact-table tr.contact-detail-row td > div { position: static !important; max-width: none !important; }
}

/* ----- ⑦ 非カード化テーブルの溢れ防止（最終保証） -----
   カード化しない素のテーブル（管理画面・重複・CSV取込・送信プレビュー等）は、
   .table-scroll ラッパーが無くても <table> 自体を display:block + overflow-x:auto にして
   横スクロール可能にする（画面外へ溢れて操作不能になるのを防ぐ）。
   ※ 内部の tr/td は table-row/table-cell のままなので表レイアウトは維持される。 */
@media (max-width: 640px) {
  .data-table:not(.responsive-cards):not(.contact-table):not(.send-work-table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* すでに .table-scroll で囲まれているテーブルはラッパー側がスクロールするので通常表のまま */
  .table-scroll .data-table:not(.responsive-cards) { display: table; }
}

/* ===== v0.95: 不具合報告（PSのクラッシュ報告風） ===== */
.err-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  transition: 0.18s;
}
.err-fab:hover { color: #7c3aed; border-color: #c4b5fd; box-shadow: 0 6px 18px rgba(124, 58, 237, 0.22); }
.err-fab i { width: 16px; height: 16px; }
.err-fab[hidden] { display: none; }

/* ===== v0.99.20: ページ別ヘルプ（❓FAB は左下・不具合報告FABと左右で分ける） ===== */
.help-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #ffffff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.18);
}
.help-fab:hover { color: #7c3aed; border-color: #c4b5fd; box-shadow: 0 6px 18px rgba(124, 58, 237, 0.26); }
.help-fab i { width: 16px; height: 16px; }
.help-modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.help-modal-overlay[hidden] { display: none; }
.help-modal {
  position: relative;
  background: #ffffff; border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.help-modal h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: #6d28d9; }
.help-modal h3 i { width: 20px; height: 20px; }
.help-intro { color: #475569; margin: 0 0 14px; }
.help-section { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed #ede9fe; }
.help-section:last-of-type { border-bottom: none; }
.help-q { font-weight: 600; color: #1e293b; margin: 0 0 4px; }
.help-q::before { content: "Q. "; color: #7c3aed; }
.help-a { color: #475569; margin: 0 0 4px; line-height: 1.7; }
.help-support { margin-top: 8px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.help-support textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 11px;
  font-size: 14px; font-family: inherit; margin-bottom: 8px;
}
.help-support-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.help-support-result { margin: 8px 0 0; font-size: 13px; }
.help-support-result.is-ok { color: #15803d; }
.help-support-result.is-error { color: #b91c1c; }
.help-modal-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: #94a3b8;
}
.help-modal-close:hover { color: #475569; }
@media (max-width: 640px) {
  .help-fab span { display: none; }   /* スマホはアイコンのみの丸ボタン */
  .help-fab { padding: 11px; }
  .help-fab i { width: 20px; height: 20px; }
}

/* ===== v0.99.16: 進捗ドック（長時間ジョブを右下に最小化して追従表示） ===== */
.job-dock {
  position: fixed;
  right: 16px;
  bottom: 68px;            /* 不具合報告FAB（bottom:16px）の上に積む */
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 300px;
  max-width: calc(100vw - 24px);
}
.job-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  padding: 12px 14px;
  animation: jobCardIn 0.25s ease;
}
@keyframes jobCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.job-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.job-card-label { font-weight: 600; font-size: 0.9rem; color: #1e293b; }
.job-card-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.15rem; line-height: 1; color: #94a3b8; padding: 0 2px;
}
.job-card-close:hover { color: #475569; }
.job-card-stage { margin-bottom: 6px; }
.job-card-foot { margin-top: 6px; word-break: break-word; }
.job-card-foot a { color: #7c3aed; font-weight: 600; }
.job-card.job-card-error { border-color: #fecaca; }
@media (max-width: 640px) {
  .job-dock { width: calc(100vw - 24px); bottom: 64px; }
}

/* 自動検知トースト */
.err-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 12px 14px 12px 16px;
  background: #1f2937;
  color: #f8fafc;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.err-toast[hidden] { display: none; }
.err-toast-msg { display: inline-flex; align-items: center; gap: 8px; }
.err-toast-msg i { width: 18px; height: 18px; color: #fbbf24; }
.err-toast-report {
  background: #7c3aed; color: #fff; border: none;
  padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.err-toast-report:hover { background: #6d28d9; }
.err-toast-close {
  background: none; border: none; color: #cbd5e1; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}

/* 報告モーダル */
.err-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1200; padding: 16px;
}
.err-modal-overlay[hidden] { display: none; }
.err-modal {
  background: #fff; border-radius: 16px; padding: 26px 24px 22px;
  max-width: 440px; width: 100%; position: relative; box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.err-modal h3 {
  margin: 0 0 10px; font-size: 19px; color: #0f172a;
  display: flex; align-items: center; gap: 8px;
}
.err-modal h3 i { color: #7c3aed; width: 20px; height: 20px; }
.err-modal-desc { margin: 0 0 16px; font-size: 14px; color: #475569; line-height: 1.7; }
.err-modal-label { display: block; font-size: 13px; font-weight: 600; color: #334155; }
.err-modal-label textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: 6px;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; resize: vertical; line-height: 1.6;
}
.err-modal-label textarea:focus { outline: none; border-color: #7c3aed; }
.err-modal-auto {
  display: flex; align-items: center; gap: 6px;
  margin: 10px 0 18px; font-size: 12px; color: #94a3b8;
}
.err-modal-auto i { width: 14px; height: 14px; }
.err-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.err-modal-err { color: #b91c1c; font-size: 13px; margin: 12px 0 0; }
.err-modal-err[hidden] { display: none; }
#errModalForm[hidden], #errModalDone[hidden] { display: none; }
.err-modal-done { text-align: center; padding: 8px 0 4px; }
.err-modal-done-icon i { width: 44px; height: 44px; color: #10b981; }
.err-modal-done p { font-size: 15px; color: #334155; line-height: 1.7; margin: 10px 0 18px; }

@media (max-width: 640px) {
  .err-fab span { display: none; }      /* スマホはアイコンのみの丸ボタンに */
  .err-fab { padding: 11px; }
  .err-fab i { width: 20px; height: 20px; }
  .err-toast { flex-wrap: wrap; bottom: 12px; }
}
