/* ============================================================
   案件とれ〜るデモ — スタイル
   ============================================================ */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --accent: #2a78d6;
  --accent-soft: #cde2fb;
  --series-before: #86b6ef;
  --series-after: #2a78d6;
  --good: #0ca30c;
  --good-text: #006300;
  --critical: #d03b3b;
  --warning-bg: #fdf3d8;
  --shadow: 0 1px 3px rgba(11, 11, 11, 0.06), 0 4px 16px rgba(11, 11, 11, 0.04);
}
/* 常にライトモードで表示（見やすさ優先でダーク自動切り替えは無効化） */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 実機での横揺れ防止: ページ自体は横方向に一切スクロールさせない（clipはstickyを壊さない） */
html, body { overflow-x: clip; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.65;
}

.app { display: flex; min-height: 100vh; }

/* ---- サイドバー ---- */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-1);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { padding: 4px 10px 16px; font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.brand span { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.08em; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border: none; background: none;
  border-radius: 8px;
  font: inherit; color: var(--text-secondary);
  cursor: pointer; text-align: left;
}
.sidebar nav button .ic { display: inline-flex; width: 22px; justify-content: center; }
/* PCは左メニューに出すので、メニュー画面側の「おまかせ営業」は重複させない（スマホは下タブに枠がないので残す） */
@media (min-width: 761px) { .pc-hide { display: none !important; } }
.sidebar nav button.nav-menu { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--grid); border-radius: 0; }
.sidebar nav button:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.sidebar nav button.active { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; }
.demo-note {
  margin-top: auto;
  font-size: 11px; color: var(--text-muted);
  padding: 10px;
  border-top: 1px solid var(--grid);
}

/* ---- メイン ---- */
main { flex: 1; padding: 28px 40px 64px; max-width: 1360px; }
.view-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.view-sub { color: var(--text-secondary); margin-bottom: 24px; font-size: 13px; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.card .card-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }

/* ---- ステータスタイル ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile .t-label { font-size: 12px; color: var(--text-secondary); }
.tile .t-value { font-size: 26px; font-weight: 700; line-height: 1.3; }
.tile .t-delta { font-size: 12px; color: var(--good-text); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- チャート（横棒） ---- */
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.bar-group { margin-bottom: 14px; }
.bar-group:last-child { margin-bottom: 0; }
.bar-group .g-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.bar-track { flex: 1; height: 18px; position: relative; }
.bar {
  height: 14px; margin-top: 2px;
  border-radius: 0 4px 4px 0;
  min-width: 3px;
  transition: filter 0.15s;
}
.bar:hover { filter: brightness(1.12); }
.bar-val { font-size: 12px; font-weight: 600; color: var(--text-primary); width: 44px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.chart-baseline { border-left: 2px solid var(--baseline); padding-left: 0; }

/* ---- バッジ ---- */
.badge {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge.heat-高 { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.heat-中 { background: color-mix(in srgb, var(--text-muted) 14%, transparent); border-color: transparent; }
.badge.heat-低 { border-style: dashed; }
.badge.st-成約 { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good-text); border-color: transparent; }
.badge.st-断り { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); border-color: transparent; }
.badge.st-new { background: var(--accent); color: #fff; border-color: transparent; }

/* ---- 顧客テーブル ---- */
table.contacts { width: 100%; border-collapse: collapse; font-size: 13px; }
table.contacts th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted);
  padding: 8px 10px; border-bottom: 1px solid var(--grid);
  letter-spacing: 0.04em;
}
table.contacts td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
table.contacts tbody tr { cursor: pointer; }
table.contacts tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.contacts tbody tr.selected { background: var(--accent-soft); }
table.contacts tbody tr.just-added { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.contact-name { font-weight: 600; }
.contact-company { color: var(--text-secondary); font-size: 12px; }

/* ---- 詳細ドロワー ---- */
.detail { margin-top: 16px; }
.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.detail .memo {
  background: var(--warning-bg);
  border-radius: 8px; padding: 10px 12px; margin: 12px 0;
  font-size: 13px;
}
.timeline { list-style: none; margin-top: 8px; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--grid); font-size: 13px; }
.timeline li:last-child { border-bottom: none; }
.timeline .tl-date { color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.timeline .tl-type { font-weight: 600; flex-shrink: 0; width: 3em; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.08s;
}
.btn:hover { background: color-mix(in srgb, var(--text-primary) 5%, var(--surface-1)); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- 名刺スキャン ---- */
.scan-stage { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .scan-stage { grid-template-columns: 1fr; } }
.camera-frame {
  border: 2px dashed var(--baseline);
  border-radius: 16px;
  padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  position: relative;
  overflow: hidden;
}
.camera-frame.scanning::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: scanline 1.1s ease-in-out infinite alternate;
}
@keyframes scanline { from { top: 12%; } to { top: 88%; } }

.biz-card {
  width: 320px; aspect-ratio: 91 / 55;
  background: #fff; color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
.biz-card .bc-stripe { position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 8px 8px 0 0; }
.biz-card .bc-company { font-size: 12px; letter-spacing: 0.06em; }
.biz-card .bc-role { font-size: 10px; color: #666; }
.biz-card .bc-name { font-size: 21px; font-weight: 700; letter-spacing: 0.14em; }
.biz-card .bc-kana { font-size: 9px; color: #888; letter-spacing: 0.2em; }
.biz-card .bc-meta { font-size: 9px; color: #555; line-height: 1.7; font-family: system-ui, sans-serif; }

.ocr-status { font-size: 13px; color: var(--text-secondary); min-height: 20px; }
.ocr-status .spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--grid); border-top-color: var(--accent);
  border-radius: 50%; margin-right: 6px; vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 12px; }
.field-grid .full { grid-column: 1 / -1; }

/* 顧客詳細の「出会った日・温度感・メモを直す」（登録後の修正用） */
.contact-edit { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.contact-edit > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); list-style: none; }
.contact-edit > summary::-webkit-details-marker { display: none; }
.contact-edit > summary:hover { color: var(--text-primary); }
.contact-edit[open] > summary { margin-bottom: 2px; }
.contact-edit textarea { min-height: 72px; resize: vertical; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; }
.field input, .field textarea, .field select {
  width: 100%; min-width: 0; box-sizing: border-box; -webkit-appearance: none; appearance: none;
  font: inherit; font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--baseline);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-primary);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field textarea { resize: vertical; min-height: 60px; }

.confidence { font-size: 11px; color: var(--good-text); margin-top: 4px; }

/* ---- メール作成 ---- */
.mail-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }
.mail-context { font-size: 13px; }
.mail-context dt { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 10px; }
.mail-context dd { margin: 0; }

.mail-editor { min-height: 120px; }
.mail-subject {
  font-weight: 700; font-size: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--grid);
  margin-bottom: 10px; min-height: 40px;
}
.mail-body { white-space: pre-wrap; font-size: 13.5px; min-height: 200px; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--accent); vertical-align: -2px; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.draft-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 10px; }
.draft-item .d-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-item .d-to { font-size: 12px; color: var(--text-muted); }
.draft-item .d-subject { font-weight: 600; }

/* ---- シミュレーション ---- */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.sim-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 13px; }
.sim-card .s-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sim-card .s-label { font-weight: 700; }
.sim-card .s-prob { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sim-card .s-reply {
  background: color-mix(in srgb, var(--text-muted) 8%, transparent);
  border-radius: 8px; padding: 10px; margin-bottom: 10px;
  font-size: 12.5px;
}
.sim-card .s-counter { font-size: 12.5px; }
.sim-card .s-counter b { color: var(--accent); }
.sim-card.tone-pos { border-top: 3px solid var(--good); }
.sim-card.tone-hold { border-top: 3px solid var(--baseline); }
.sim-card.tone-rej { border-top: 3px solid var(--critical); }

/* ---- 改善ループ ---- */
.loop-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; font-size: 12px; }
.loop-steps .step {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; color: var(--text-secondary);
}
.loop-steps .arrow { align-self: center; color: var(--text-muted); }

.imp-card { margin-top: 14px; }
.imp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.imp-head .cat { font-weight: 700; font-size: 15px; }
.imp-insight { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .ba-grid { grid-template-columns: 1fr; } }
.ba-col { border: 1px solid var(--grid); border-radius: 8px; padding: 12px; font-size: 12.5px; }
.ba-col.after { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.ba-col .ba-tag { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.ba-col.after .ba-tag { color: var(--accent); }
.ba-col .ba-subject { font-weight: 600; margin-bottom: 4px; }
.recovery { margin-top: 10px; font-size: 12.5px; background: var(--warning-bg); border-radius: 8px; padding: 10px 12px; }
.imp-result { margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--good-text); }

/* ---- トースト ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text-primary); color: var(--page);
  padding: 11px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  opacity: 0; transition: all 0.25s ease;
  pointer-events: none;
  z-index: 1100; /* モーダル（1000）より前に出す */
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- ツールチップ ---- */
#tip {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--text-primary); color: var(--page);
  font-size: 12px; padding: 5px 10px; border-radius: 7px;
  opacity: 0; transition: opacity 0.1s;
  white-space: nowrap;
}
#tip.show { opacity: 1; }

/* ---- 提案サポート ---- */
.ana-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }

.progress-list { list-style: none; display: grid; gap: 10px; font-size: 13.5px; }
.progress-list li { color: var(--text-muted); display: flex; gap: 10px; align-items: center; }
.progress-list li.now { color: var(--text-primary); font-weight: 600; }
.progress-list li.done { color: var(--good-text); }
.progress-list .p-icon { width: 18px; text-align: center; flex-shrink: 0; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--grid); margin-bottom: 16px; }
.tab-btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 14px; border: none; background: none; cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.dot-list { padding-left: 1.3em; font-size: 13px; display: grid; gap: 6px; }

.threec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.comp-item { font-size: 12.5px; padding: 8px 0; border-bottom: 1px dashed var(--grid); }
.comp-item:last-child { border-bottom: none; }
.comp-item .ok { color: var(--good-text); }
.comp-item .ng { color: var(--critical); }

table.flow-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
table.flow-table th {
  text-align: left; font-size: 11px; color: var(--text-muted);
  padding: 6px 10px; border-bottom: 1px solid var(--grid);
}
table.flow-table td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.flow-table td.stage { font-weight: 700; white-space: nowrap; }
table.flow-table td.improve { color: var(--accent); }

.issue-card { margin-bottom: 10px; }
.issue-head { display: flex; gap: 10px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.issue-body { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }
.prio { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; flex-shrink: 0; }
.prio-高 { background: color-mix(in srgb, var(--critical) 13%, transparent); color: var(--critical); }
.prio-中 { background: color-mix(in srgb, var(--text-muted) 15%, transparent); color: var(--text-secondary); }

.mini-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mini-slide {
  border: 1px solid var(--baseline);
  border-radius: 8px;
  background: var(--surface-1);
  padding: 16px 18px 16px;
  position: relative;
  box-shadow: var(--shadow);
}
.mini-slide .ms-num {
  position: absolute; top: 10px; right: 12px;
  font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.mini-slide .ms-title {
  font-weight: 700; font-size: 14px; line-height: 1.5;
  margin: 0 22px 10px 0;
}
.mini-slide ul { margin: 0; padding-left: 1.2em; font-size: 12px; line-height: 1.7; color: var(--text-secondary); display: grid; gap: 6px; }

.sheet .sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-sec { font-weight: 700; font-size: 13px; margin: 16px 0 4px; color: var(--accent); }
.sheet-q { font-size: 13px; padding: 7px 0 14px; border-bottom: 1px solid var(--grid); }
.sheet-q:last-child { border-bottom: none; }
.sheet-line { display: block; margin-top: 12px; border-bottom: 1px dotted var(--baseline); }

.footnote { font-size: 11px; color: var(--text-muted); margin-top: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ---- スマホ対応 ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.menu-toggle { display: none; }

/* 右上ハンバーガーメニュー＋ログイン（スマホのみ表示） */
#menu-fab { display: none; }
/* PC: サイドバーのブランド直下に幅いっぱいで表示 */
#login-fab {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 4px 10px; height: 34px; padding: 0 12px;
  font: inherit; font-size: 12.5px; font-weight: 700;
  border: none; border-radius: 8px;
  background: var(--accent, #2563eb); color: #fff; cursor: pointer;
}
#login-fab.authed {
  background: transparent; color: var(--text-muted, #6b7683);
  border: 1px solid var(--border); font-weight: 600;
}
/* メニュー画面（PC）の閉じるボタン */
.view-title .view-close {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  border: 1px solid var(--border); background: var(--surface-1); border-radius: 8px;
  padding: 5px 10px; cursor: pointer;
}
.view-title .view-close:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.view-title.with-close { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  #login-fab {
    margin: 0;
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 52px;
    height: 30px; padding: 0 10px; font-size: 11.5px; font-weight: 700;
    border: none; border-radius: 8px;
    background: var(--accent, #2563eb); color: #fff;
    cursor: pointer; z-index: 51; white-space: nowrap;
  }
  /* 右上ボタンとタイトルの重なり防止（サブタイトルは非表示に） */
  .sidebar .brand { margin-right: 132px; overflow: hidden; white-space: nowrap; }
  .sidebar .brand span { display: none; }
  #login-fab.authed {
    background: transparent; color: var(--text-muted, #6b7683);
    border: 1px solid var(--border); font-weight: 600;
  }
}
.menu-close-bar {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 14px; padding: 14px;
  font: inherit; font-size: 14px; font-weight: 700;
  border: none; border-radius: 12px;
  background: #1c2430; color: #fff; cursor: pointer;
}
@media (max-width: 760px) {
  #menu-fab {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 6px; right: 10px;
    width: 40px; height: 40px; font-size: 23px; line-height: 1;
    padding: 0;
    border: none; border-radius: 10px;
    background: transparent; color: var(--text);
    cursor: pointer; z-index: 51;
  }
}

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto;
    position: sticky; top: 0; z-index: 50;
    flex-direction: column; gap: 6px;
    padding: 10px 12px 10px;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0 4px 2px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
  .brand span { display: inline; }
  /* スマホはタブバーに集約: サイドバーのメニューと規約リンクは非表示 */
  .sidebar nav { display: none; }
  .legal-links { display: none; }
  .demo-note { display: none; }
  main { padding: 18px 14px 56px; }
  .view-sub { margin-bottom: 16px; }
  /* 顧客リスト: 見出し・手入力ボタン・タブをスマホでは上部に固定（アプリのヘッダー直下） */
  .contact-head { position: sticky; top: var(--hdr-h, 0px); z-index: 20; background: var(--page); margin: -18px -14px 0; padding: 14px 14px 0; }
  table.contacts { min-width: 560px; }
  .biz-card { width: 100%; max-width: 320px; }
  .camera-frame { padding: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .detail-head .btn { width: 100%; justify-content: center; }
}

/* ---- 名刺スキャン（実機能） ---- */
.camera-frame { position: relative; }
/* 映像とガイド枠をひとまとめにする。枠は映像に対して位置を決める */
/* 映像は切らずに縮めて1画面に収める（幅いっぱいか高さ50vhの小さいほう）。枠は映像にぴったり重ねる */
.scan-cam { position: relative; width: 100%; line-height: 0; border-radius: 8px; overflow: hidden; }
.scan-video { width: 100%; border-radius: 8px; background: #111; display: block; aspect-ratio: 4 / 3; object-fit: cover; max-height: 78vh; }
/* 複数枚モードのガイド枠: 映像のほぼ全面（名刺は枠内に自由に並べてよい） */
.scan-guide.multi { top: 3%; bottom: 3%; left: 3%; right: 3%; transform: none; aspect-ratio: auto; }
.scan-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 0 0 10px; }
.scan-toggles .seg-wrap { display: grid; gap: 5px; }
.scan-toggles .seg-wrap:first-child { grid-column: 1 / -1; }
.scan-toggles .seg-label { font-size: 13px; font-weight: 700; color: var(--text-primary); text-align: center; }
/* 見本（2026-09-24 米山）: 角の小さい四角・選択中は青ベタ＋白文字・幅いっぱい・指で押しやすい高さ */
.scan-toggles .seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface-1); }
.scan-toggles .seg button { font: inherit; font-size: 15px; font-weight: 600; min-height: 46px; padding: 8px 4px; border: 0; background: none; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.scan-toggles .seg button + button { border-left: 1px solid var(--border); }
.scan-toggles .seg button.on { background: var(--accent); color: #fff; }
.scan-toggles .seg button:disabled { opacity: .5; cursor: default; }
.scan-shot { width: 100%; border-radius: 8px; display: block; border: 1px solid var(--border); }
/* 名刺の比率（91×55mm）に合わせた枠。中央に置く */
.scan-guide {
  position: absolute; left: 6%; right: 6%; top: 50%; transform: translateY(-50%);
  aspect-ratio: 91 / 55;
  border: 2px dashed rgba(255,255,255,0.9); border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 0 1000px rgba(0,0,0,0.35);   /* 枠の外側を軽く暗くして、どこに入れるか分かりやすくする */
}
.auto-shot { width: 100%; display: grid; gap: 4px; justify-items: center; margin-top: 4px; }
.auto-shot span { font-size: 12px; color: var(--text-secondary); }
.auto-shot .chip-btn { margin-top: 2px; }
.auto-bar { width: min(220px, 80%); height: 4px; border-radius: 99px; background: var(--grid); overflow: hidden; }
.auto-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .18s linear; }
.auto-debug { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.scan-placeholder {
  display: grid; place-content: center; text-align: center; gap: 6px;
  aspect-ratio: 4 / 3; border: 1px dashed var(--baseline); border-radius: 8px;
  background: var(--surface-1); color: var(--text-muted); font-size: 28px;
}
.scan-placeholder span { font-size: 12px; }
.scan-hint { font-size: 12px; color: var(--text-secondary); margin-top: 10px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.scan-pair { display: flex; gap: 10px; }
.scan-pair figure { flex: 1; margin: 0; min-width: 0; text-align: center; }
.scan-pair figcaption { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.scan-pair .scan-shot { width: 100%; }
.scan-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
/* 縦積みのボタン群（裏面待ち・カメラ）: 幅を揃えて中央に */
.scan-actions.stack { flex-direction: column; align-items: center; }
.scan-actions.stack .btn { width: min(100%, 320px); justify-content: center; }
.scan-note { font-size: 11px; color: var(--text-muted); margin-top: 8px; text-align: center; }
.scan-error { font-size: 12px; color: var(--critical); background: var(--warning-bg); border-radius: 6px; padding: 8px 10px; margin-top: 10px; }
.scan-progress { height: 6px; background: var(--grid); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.scan-bar { height: 100%; background: var(--accent); transition: width .2s ease; }
.scan-raw { margin-top: 10px; padding: 10px; background: var(--page); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; white-space: pre-wrap; max-height: 200px; overflow: auto; color: var(--text-secondary); }
@media (max-width: 900px) { .scan-stage { grid-template-columns: 1fr; } }
.scan-warn { border: 1px solid #e8a33d; background: #fff7e8; border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; color: #6b4a08; }
.scan-warn-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: #9a5b00; }
.scan-warn-title svg { color: #e8a33d; flex: none; }
.scan-warn-body { font-size: 13px; line-height: 1.6; margin-top: 6px; }
.scan-warn-meta { font-size: 11px; color: #8a6a2a; margin-top: 6px; }
.scan-notice-inline { font-size: 11px; color: var(--text-secondary); background: var(--warning-bg); border-radius: 6px; padding: 6px 8px; margin-top: 6px; }

/* 交流会モード（まとめて取り込み） */
.scan-batchbar {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; margin-bottom: 10px; text-align: center;
}
.batch-list { display: grid; gap: 6px; margin-top: 12px; max-height: 320px; overflow: auto; }
.batch-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1);
}
.chip-btn { padding: 4px 10px; font-size: 12px; }
.star-btn {
  border: none; background: none; cursor: pointer; padding: 0 2px;
  font-size: 18px; line-height: 1; color: var(--text-muted);
}
.star-btn.on { color: #e8a33d; }
.star-toggle {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary);
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); cursor: pointer;
}
/* チェックボックスは隠し、星そのものをタップで切り替える（iOSで四角い箱が星に重なって押せない対策） */
.star-toggle { position: relative; user-select: none; -webkit-tap-highlight-color: transparent; }
.star-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.star-toggle span { display: inline-flex; align-items: center; gap: 6px; }
.star-toggle svg { color: #b8b3aa; transition: color .15s, fill .15s; }
.star-toggle:has(input:checked) { color: #9a6b12; border-color: #e8a33d; background: #fff7e8; }
.star-toggle:has(input:checked) svg { color: #e8a33d; fill: #e8a33d; }
.howto-btn {
  margin-left: 10px; vertical-align: middle;
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  color: var(--text-secondary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 99px; padding: 6px 10px; cursor: pointer;
}
.howto-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---- アイコン（Lucide・絵文字の代わり） ---- */
.ic-svg { vertical-align: -3px; flex: none; }
.btn .ic-svg { margin-right: 6px; }
.ic-svg.fill { fill: currentColor; }
.sns-links { display: inline-flex; gap: 6px; align-items: center; }
.sns-links a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-secondary); background: var(--surface-1); }
.sns-links a:hover { color: var(--accent); border-color: currentColor; }
.sns-links .ic-svg { vertical-align: 0; }
.star-btn .ic-svg { width: 20px; height: 20px; }
.star-btn.on { color: #e8a33d; }
.star-btn.on .ic-svg { fill: currentColor; }
.cd-actions .round .ic-svg { margin: 0; }
.cd-section .ic-svg { color: var(--text-secondary); }
.howto-btn .ic-svg { margin-right: 4px; }

/* ---- 連絡先（Eight風の一覧・詳細） ---- */
.cardthumb {
  display: inline-block; width: 64px; aspect-ratio: 91 / 55; border-radius: 4px; overflow: hidden;
  background: var(--surface-1); border: 1px solid var(--border); flex: none;
}
.cardthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cardthumb.empty { display: none; }
.batch-row { grid-template-columns: auto auto 1fr auto; }
.batch-row .cardthumb { width: 52px; }
.star-mark { color: #e8a33d; display: inline-flex; margin-left: 4px; }
/* ワンタップの重要マーク（一覧・詳細） */
.star-tap {
  border: none; background: none; cursor: pointer; padding: 6px; margin: -6px 0 -6px 2px; border-radius: 50%;
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.star-tap .ic-svg { margin: 0; opacity: .55; }
.star-tap.on { color: #e8a33d; }
.star-tap.on .ic-svg { fill: currentColor; opacity: 1; }
.star-tap:active { transform: scale(1.2); }
.star-tap.big { padding: 8px; margin-left: 4px; }

/* 一覧 */
.sync-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.sync-bar .btn { margin-left: auto; }
.sync-bar .btn.primary { color: #fff; }
.sync-bar.on { color: var(--text-muted); }
.sync-bar .sync-err { flex-basis: 100%; color: #d03b3b; font-weight: 600; }
.contact-tools { margin: 4px 0 10px; }
.contact-search {
  display: flex; align-items: center; gap: 8px; color: var(--text-muted);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 99px; padding: 10px 16px;
}
.contact-search input { border: none; background: none; font: inherit; font-size: 15px; width: 100%; outline: none; color: var(--text-primary); }
.contact-subbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; font-size: 13px; }
.contact-subbar .count { color: var(--text-muted); }
.contact-sort { display: flex; align-items: center; gap: 8px; }
.contact-sort button { font: inherit; font-size: 13px; border: none; background: none; color: var(--accent); cursor: pointer; padding: 4px 2px; }
.contact-sort button.on { color: var(--text-primary); font-weight: 700; }
.contact-sort .sep { color: var(--border); }
.contact-month { font-size: 15px; font-weight: 700; color: var(--text-muted); margin: 18px 0 4px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 16px 4px; border-bottom: 1px solid var(--grid); cursor: pointer;
}
.contact-row:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.contact-row.just-added { animation: flash 1.6s ease-out; }
.contact-row .name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.contact-row .company { font-size: 15px; color: var(--text-primary); margin-top: 2px; }
.contact-row .role { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.contact-row .cardthumb { width: 96px; }
.contact-empty { padding: 36px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }
.contact-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--grid); }

/* 絞り込み（Eight風） */
.contact-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 4px 0 10px; }
.cf-wrap { position: relative; min-width: 128px; }
.cf-title { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.cf-title .ic-svg { margin: 0; }
.cf-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-1); color: var(--text-primary); cursor: pointer; text-align: left; }
.cf-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-btn .ic-svg { margin: 0; color: var(--text-muted); flex: none; }
.cf-btn.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cf-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 240px; max-height: 320px; overflow: auto; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; display: grid; gap: 2px; }
.cf-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); padding: 6px 8px; }
.cf-pop input[type=date] { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--page); color: var(--text-primary); min-width: 0; }
.cf-quick { display: flex; gap: 6px; padding: 4px 8px 6px; }
.cf-quick button { font: inherit; font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 99px; background: var(--page); cursor: pointer; color: var(--text-secondary); }
.cf-opt { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 13px !important; color: var(--text-primary) !important; border-radius: 6px; cursor: pointer; }
.cf-opt:hover { background: var(--page); }
.cf-opt span { flex: 1; }
.cf-opt em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.cf-none { font-size: 12px; color: var(--text-muted); padding: 8px; }
.cf-clear { font: inherit; font-size: 12.5px; color: var(--text-secondary); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 8px 4px; }
@media (max-width: 760px) { .contact-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .cf-wrap { flex: none; min-width: 120px; } }

/* PC の表 */
.ct-scroll { overflow-x: auto; }
.ct { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ct th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ct td { padding: 14px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.ct-row { cursor: pointer; }
.ct-row:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.ct-row.selected td { background: var(--accent-soft); }
.ct-row.just-added td { animation: flash 1.6s ease-out; }
.ct-thumb { width: 92px; }
.ct-thumb .cardthumb { width: 84px; }
.ct-thumb .cardthumb.ph { display: inline-block; background: var(--page); }
.ct-name .name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 4px; }
.ct-name .company { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.ct-role { color: var(--text-secondary); max-width: 220px; }
.ct-contact { font-size: 12.5px; color: var(--text-secondary); max-width: 240px; }
.ct-contact div { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ct-contact .ic-svg { margin: 0; flex: none; }
.ct-contact .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-date { white-space: nowrap; color: var(--text-secondary); font-size: 13px; }
.ct-num { white-space: nowrap; color: var(--text-secondary); font-size: 13px; }
.ct-num .ic-svg { margin-right: 3px; }

/* PC の右パネル */
.cd-overlay { position: fixed; inset: 0; background: rgba(20,24,30,.28); z-index: 58; }
.cd-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 64vw); background: var(--page); z-index: 59; overflow: auto; padding: 8px 28px 40px; box-shadow: -8px 0 32px rgba(0,0,0,.14); animation: cd-in .22s ease-out; }
@keyframes cd-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.cd-drawer .cd-page { max-width: none; padding-bottom: 40px; }
.cd-drawer .cd-bar { top: 0; }
.cd-drawer .cd-fab { display: none; }
.cd-photo-actions { display: flex; justify-content: center; gap: 18px; margin: -6px 0 14px; }
.cd-photo-actions .cd-textbtn { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.cd-textbtn { display: block; margin: -6px auto 14px; font: inherit; font-size: 13px; color: var(--accent); background: none; border: none; cursor: pointer; }
.cd-linkbtn.slim { margin: 8px auto 0; width: auto; padding: 6px 16px; font-size: 13px; background: none; }

/* 名刺情報の一覧モーダル */
.ci-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(20,24,30,.45); display: grid; place-items: center; padding: 16px; }
.ci-modal { position: relative; width: min(680px, 100%); max-height: 92vh; overflow: auto; background: var(--surface-1); border-radius: 14px; padding: 24px 28px 28px; box-shadow: 0 16px 48px rgba(0,0,0,.24); }
.ci-modal h2 { font-size: 18px; margin: 0 0 16px; }
.ci-close { position: absolute; top: 14px; right: 14px; }
.ci-photo { width: min(480px, 100%); margin: 0 auto; aspect-ratio: 91 / 55; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--page); }
.ci-photo-back { margin-top: 10px; }
.ci-photo img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--page); }
.ci-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.ci-table th { text-align: left; font-weight: 400; color: var(--text-secondary); width: 130px; padding: 12px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.ci-table td { padding: 12px 8px; border-bottom: 1px solid var(--grid); word-break: break-all; }
.ci-table a { color: var(--accent); }

/* 詳細（別画面） */
.cd-page { position: relative; padding-bottom: 80px; }
.cd-bar {
  position: sticky; top: var(--hdr-h, 0px); z-index: 20; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px;
  padding: 8px 0 10px; margin: -8px 0 4px; background: var(--page);
}
.cd-bar-title { text-align: center; font-weight: 700; font-size: 16px; opacity: 0; transition: opacity .15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-bar-title.show { opacity: 1; }
.cd-iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface-1); color: var(--text-primary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.cd-iconbtn.small { width: 32px; height: 32px; box-shadow: none; }
.cd-menu {
  position: absolute; right: 0; top: 56px; z-index: 30; min-width: 220px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: grid;
}
.cd-menu button { font: inherit; font-size: 14px; text-align: left; border: none; background: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text-primary); display: flex; align-items: center; }
.cd-menu button:hover { background: var(--page); }
.cd-menu button.danger { color: #d03b3b; }
.cd-menu .ic-svg { margin-right: 8px; }
.cd-head { padding: 8px 0 12px; }
.cd-name { font-size: 24px; margin: 0; display: flex; align-items: center; }
.cd-kana { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cd-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.cd-actions .round {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: none; flex: none; text-decoration: none;
}
.cd-actions .round .ic-svg { margin: 0; }
.cd-actions .round.disabled { background: var(--grid); color: var(--text-muted); pointer-events: none; }
.cd-primary {
  flex: 1; height: 44px; border-radius: 99px; border: none; background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; min-width: 0;
}
.cd-primary .ic-svg { margin: 0; }
.cd-primary.secondary { background: var(--surface-1); color: var(--accent); border: 1.5px solid var(--accent); }
.cd-actions { flex-wrap: wrap; }
.cd-actions .cd-primary { flex: 1 1 150px; }
.card-photo {
  width: 100%; aspect-ratio: 91 / 55; border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-1); position: relative; cursor: pointer; margin: 0 0 14px;
}
.card-photo img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--page); }
.card-photo.empty { display: none; }
.card-photo .flip { position: absolute; right: 8px; bottom: 8px; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer; font-family: inherit; }
/* 表裏スライド（スワイプで切替・スクロールスナップ） */
.card-photo.has-back { cursor: default; }
.card-slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.card-slides::-webkit-scrollbar { display: none; }
.card-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.card-slide img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--page); }
.card-dots { display: flex; justify-content: center; gap: 7px; margin: -6px 0 10px; }
.card-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--grid); transition: background .15s; }
.card-dots span.on { background: var(--text-muted); }
.cd-block { padding: 14px 0; border-bottom: 1px solid var(--grid); }
.cd-company { font-size: 20px; font-weight: 700; }
.cd-role { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.cd-links { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; font-size: 15px; }
.cd-links li { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cd-links a { color: var(--accent); text-decoration: none; word-break: break-all; }
.cd-links .ic { width: 20px; color: var(--text-muted); flex: none; display: inline-flex; }
.cd-links .pill { font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 1px 6px; flex: none; }
.cd-linkbtn {
  display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 99px; border: none;
  background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.cd-editbox { margin-top: 12px; }
.cd-editbox .field-grid { margin-top: 0; }
.cd-editbtns { display: flex; gap: 8px; margin-top: 12px; }
.cd-met-row { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.cd-met-row b { color: var(--accent); }
.cd-met-place { color: var(--text-secondary); font-size: 13px; }
.cd-met-row .cd-iconbtn { margin-left: auto; }
.cd-section { font-size: 16px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.cd-section .ic-svg { color: var(--text-secondary); }
.cd-section-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.career { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.career li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); align-items: start; }
.career li.career-now { border-color: var(--accent-soft); background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface-1)); }
.career .career-body { min-width: 0; display: grid; gap: 4px; }
.career .career-when { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.career .career-badge { font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 7px; line-height: 1.4; }
.career .co { font-weight: 700; font-size: 16px; line-height: 1.3; }
.career .rl { font-size: 13px; color: var(--text-secondary); }
.career .career-contact { display: grid; gap: 3px; margin-top: 4px; }
.career .career-contact a { font-size: 13px; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.career .career-contact .ic-svg { color: var(--text-muted); flex: none; }
.career .cardthumb { width: 84px; }
.cd-section-note { flex-basis: 100%; font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: -4px; }
.cd-section:has(.cd-section-note) { flex-wrap: wrap; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag-list .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: var(--surface-1); border: 1px solid var(--border); }
.tag-list .tag button { border: none; background: none; cursor: pointer; color: var(--text-muted); padding: 0; display: inline-flex; }
.tag-add { display: inline-flex; align-items: center; gap: 4px; }
.tag-add input { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px dashed var(--border); border-radius: 99px; width: 130px; background: var(--page); color: var(--text-primary); min-width: 0; }
.cd-memo { width: 100%; min-height: 96px; box-sizing: border-box; font: inherit; font-size: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); color: var(--text-primary); resize: vertical; }
.cd-fab {
  position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40;
  width: 60px; height: 60px; border-radius: 50%; border: none; background: var(--surface-1); color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,.16); display: grid; place-items: center; gap: 0; cursor: pointer; font: inherit; font-size: 10px; font-weight: 700;
}
.cd-fab .ic-svg { margin: 0; }
@media (min-width: 761px) {
  .cd-page { max-width: 640px; }
  .cd-fab { bottom: 24px; right: 24px; }
  .contact-row .cardthumb { width: 110px; }
}
@media (max-width: 640px) {
  .contact-row .cardthumb { width: 84px; }
}

/* おまかせ営業: 発掘中の表示 */
@keyframes trail-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.pr-loading { text-align: center; padding: 18px 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); }
.pr-loading-img { width: 132px; height: 132px; object-fit: cover; border-radius: 18px; display: block; margin: 0 auto 8px; animation: trail-bob 1.6s ease-in-out infinite; }
.pr-loading.done .pr-loading-img { animation: none; }
.pr-loading-msg { font-size: 17px; font-weight: 700; }
.pr-loading-msg.pop { animation: pr-pop .35s ease-out; }
@keyframes pr-pop { from { transform: translateY(4px); opacity: .3; } to { transform: none; opacity: 1; } }
.pr-loading-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.pr-loading-bar { height: 6px; border-radius: 99px; background: var(--grid); overflow: hidden; margin: 12px auto 0; max-width: 280px; }
.pr-loading-bar i { display: block; height: 100%; width: 8%; background: var(--accent); border-radius: 99px; transition: width 1s linear; }
.pr-loading-note { font-size: 12px; color: var(--text-secondary); margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--page); line-height: 1.6; }

/* 新しい版の案内 */
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 70;
  background: #1c2430; color: #fff; font-size: 13px; padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2);
  display: flex; gap: 10px; align-items: center; white-space: nowrap;
}
.update-bar button { font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); border: none; border-radius: 99px; padding: 6px 12px; cursor: pointer; }
@media (min-width: 761px) { .update-bar { bottom: 24px; } }

/* 同一人物の名刺更新 */
.link-diff {
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1);
  padding: 10px 12px; margin-bottom: 14px; font-size: 13px; display: grid; gap: 6px;
}
.link-diff span { display: inline-block; min-width: 92px; font-size: 11px; color: var(--text-muted); }
.link-diff .to { color: var(--accent); }
.card-history { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.card-history li {
  display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1);
  font-size: 13px;
}
.batch-memo { grid-column: 1 / -1; margin-top: 6px; }
.batch-memo textarea {
  width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; min-height: 60px; resize: vertical;
  border: 1px solid var(--border); border-radius: 8px; background: var(--page); color: var(--text);
}
.multi-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: var(--surface-1); }
.multi-head { display: flex; align-items: center; gap: 8px; }
.multi-head span { flex: 1; }
.multi-item .field-grid { margin-top: 8px; }


/* ============================================================
   同意モーダル & 法的ページ
   ============================================================ */

.consent-lock { overflow: hidden; }
.consent-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(11, 11, 11, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: consentFade 0.25s ease;
}
.consent-overlay.closing { opacity: 0; transition: opacity 0.25s ease; }
@keyframes consentFade { from { opacity: 0; } to { opacity: 1; } }
.consent-modal {
  background: var(--surface-1);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 28px;
}
.consent-modal h2 { font-size: 18px; margin-bottom: 8px; }
.consent-lead { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 14px; }
.consent-points {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
  background: var(--page); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.consent-points li {
  font-size: 12.5px; color: var(--text-secondary);
  padding-left: 18px; position: relative;
}
.consent-points li::before { content: "・"; position: absolute; left: 2px; color: var(--accent); }
.consent-links { font-size: 13px; margin-bottom: 16px; }
.consent-links a { color: var(--accent); }
.consent-check {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13.5px; cursor: pointer; margin-bottom: 16px;
}
.consent-check input { margin-top: 3px; accent-color: var(--accent); }
.consent-btn { width: 100%; padding: 13px; font-size: 14px; }
.consent-btn + .consent-btn { margin-top: 10px; }   /* 縦に並ぶボタンの間隔（2026-09-24 米山指摘） */
/* 撮影モードの説明（初回ポップアップ） */
.mode-opts { display: grid; gap: 10px; margin-bottom: 16px; }
.mode-opt { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.mode-opt .ic-svg { color: var(--accent); margin-top: 2px; }
.mode-opt b { display: block; font-size: 14px; margin-bottom: 2px; }
.mode-opt span { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.consent-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* サイドバー下部の規約リンク */
.legal-links { margin-top: 8px; padding: 0 10px; font-size: 11px; color: var(--text-muted); }
.legal-links a { color: var(--text-muted); text-decoration: underline; }
.legal-links a:hover { color: var(--text-secondary); }

/* 法的ページ（privacy.html / terms.html） */
.legal-body { background: var(--page); }
.legal-wrap {
  max-width: 760px; margin: 0 auto; padding: 40px 24px 80px;
}
.legal-back { display: inline-block; font-size: 13px; color: var(--accent); margin-bottom: 24px; text-decoration: none; }
.legal-back:hover { text-decoration: underline; }
.legal-wrap h1 { font-size: 24px; margin-bottom: 6px; }
.legal-wrap h2 { font-size: 16px; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.legal-wrap h3 { font-size: 14px; margin: 16px 0 6px; }
.legal-wrap p { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 10px; }
.legal-wrap ul, .legal-wrap ol { font-size: 13.5px; color: var(--text-secondary); padding-left: 22px; margin-bottom: 10px; }
.legal-wrap li { margin-bottom: 4px; }
.legal-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.legal-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px;
  background: var(--surface-1);
}
.legal-table th, .legal-table td {
  border: 1px solid var(--grid); padding: 8px 12px; text-align: left;
  color: var(--text-secondary); vertical-align: top;
}
.legal-table th { background: var(--page); color: var(--text-primary); font-weight: 600; white-space: nowrap; }

/* ============================================================
   見積もり（松竹梅・計算式・予算逆算）
   ============================================================ */
.tier-banner {
  font-size: 13px; color: var(--text-secondary);
  padding: 10px 14px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  margin-bottom: 12px;
}
.pkg {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); padding: 18px;
  display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px;
}
.pkg.reco { border-color: var(--accent); border-width: 2px; }
.pkg .reco-tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 10px; }
.pkg .pkg-name { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.pkg .pkg-price { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pkg .pkg-price small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.pkg .pkg-formula { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pkg .pkg-note { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.breakdown { border-top: 1px solid var(--grid); margin-top: 2px; padding-top: 2px; }
.breakdown summary { font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; padding: 6px 0; list-style: none; }
.breakdown summary::before { content: "▸ "; }
.breakdown[open] summary::before { content: "▾ "; }
.breakdown table { width: 100%; border-collapse: collapse; font-size: 12px; color: var(--text-secondary); }
.breakdown td { padding: 3px 0; }
.breakdown td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 10px; }
.breakdown tr.sum td { border-top: 1px solid var(--grid); padding-top: 5px; font-weight: 700; color: var(--text-primary); }

/* メールのトーン切替チップ */
.tone-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tone-chips button {
  font: inherit; font-size: 12px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-secondary); cursor: pointer;
}
.tone-chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 前情報の充実度メーター */
.acc-meter { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.acc-meter .acc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.acc-meter .acc-head b { font-size: 16px; color: var(--accent); font-variant-numeric: tabular-nums; }
.acc-meter .acc-bar { height: 8px; border-radius: 999px; background: var(--grid); overflow: hidden; margin-top: 6px; }
.acc-meter .acc-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.35s ease; }
.acc-meter .acc-note { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================
   オンボーディング（フルスクリーン・ステップ式）
   ============================================================ */
.onboard {
  position: fixed; inset: 0; z-index: 60;
  background: var(--page);
  overflow-y: auto;
  display: flex; justify-content: center;
}
.onboard.closing { animation: ob-fade 0.25s ease forwards; }
@keyframes ob-fade { to { opacity: 0; } }
.ob-col {
  width: 100%; max-width: 430px; min-height: 100%;
  display: flex; flex-direction: column;
  padding: 22px 22px calc(24px + env(safe-area-inset-bottom));
}
.ob-col--welcome { justify-content: center; }
.ob-col--welcome .ob-hero { flex: 0 0 auto; }
.ob-col--welcome .ob-bottom { margin-top: 34px; }
.ob-top { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin-bottom: 4px; }
.ob-back, .ob-skip {
  font: inherit; font-size: 13px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.ob-skip { text-decoration: underline; font-size: 12px; }
.ob-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; }
.ob-mascot { width: 180px; height: 180px; object-fit: contain; margin: 0 auto; background: none; }
.ob-wordmark { display: flex; flex-direction: column; align-items: center; gap: 0; }
.ob-wordmark .ruby { font-size: 12px; font-weight: 600; letter-spacing: 0.35em; color: #3d4265; margin-left: 0.35em; }
.ob-wordmark .word { font-size: 42px; font-weight: 800; letter-spacing: 0.01em; color: #3d4265; line-height: 1.25; }
.ob-tagline { font-size: 14px; color: #6b6e85; display: flex; align-items: center; justify-content: center; gap: 10px; }
.ob-tagline .blank { display: inline-block; width: 46px; height: 1px; background: #9a9db2; }
.ob-lead { font-size: 13.5px; color: var(--text-secondary); text-wrap: balance; }
.ob-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.ob-form h2 { font-size: 21px; }
.ob-field { display: flex; flex-direction: column; gap: 5px; }
.ob-field label { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.05em; }
.ob-field input, .ob-field textarea {
  font: inherit; font-size: 15px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1);
}
.ob-field .ob-note { font-size: 11px; color: var(--text-muted); }
.ob-unit-row { display: flex; gap: 10px; }
.ob-unit-row .ob-field { flex: 1; }
.ob-bottom { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.ob-cta {
  width: 100%; font: inherit; font-weight: 700; font-size: 15px;
  padding: 15px; border: none; border-radius: 999px;
  background: var(--accent); color: #fff; cursor: pointer;
}
.ob-cta:disabled { opacity: 0.5; cursor: not-allowed; }
.ob-legal { font-size: 10.5px; color: var(--text-muted); text-align: center; }
.ob-legal a { color: var(--text-muted); }
.ob-agree {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; color: var(--text-secondary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
  cursor: pointer; user-select: none;
}
.ob-agree input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
/* 登録フローのステップ表示（あと何ステップかを示す） */
.ob-stepper { margin: 4px 0 18px; }
.ob-stepper-count {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--text-muted); text-align: center; margin: 0 0 10px;
}
.ob-stepper ol {
  display: flex; list-style: none; margin: 0; padding: 0;
}
.ob-stepper li {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
/* ステップ同士をつなぐ線（円の中心の高さに合わせる） */
.ob-stepper li::before {
  content: ""; position: absolute; top: 14px; right: 50%;
  width: 100%; height: 2px; background: var(--grid);
}
.ob-stepper li:first-child::before { display: none; }
.ob-stepper li.done::before, .ob-stepper li.cur::before { background: var(--accent); }
.ob-stepper .ob-step-num {
  position: relative; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1;
  background: var(--grid); color: var(--text-muted);
  transition: background 0.25s, color 0.25s;
}
.ob-stepper li.done .ob-step-num,
.ob-stepper li.cur .ob-step-num { background: var(--accent); color: #fff; }
.ob-stepper .ob-step-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center;
}
.ob-stepper li.cur .ob-step-label { color: var(--text); }
.ob-done { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: center; }
.ob-done .ic { font-size: 44px; }
.ob-done h2 { font-size: 20px; }
.ob-done p { font-size: 13px; color: var(--text-secondary); text-wrap: balance; }
.ob-scan-btn {
  align-self: flex-start;
  font: inherit; font-size: 13px; font-weight: 700; padding: 8px 14px;
  border: 1px solid var(--accent); color: var(--accent); background: var(--surface-1);
  border-radius: 999px; cursor: pointer;
}

/* ============================================================
   下タブバー＋中央FAB（スマホのみ）
   ============================================================ */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 55;
    display: flex; align-items: stretch;
    background: color-mix(in srgb, var(--surface-1) 96%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar > button {
    flex: 1;
    font: inherit; font-size: 10px; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: none; background: none; color: var(--text-muted); cursor: pointer;
    padding: 4px 0; border-radius: 8px;
  }
  .tabbar > button .ic { font-size: 20px; line-height: 1.2; }
  .tabbar > button.active { color: var(--accent); font-weight: 700; }
  .tabbar .fab-slot { flex: 1; position: relative; }
  .tabbar .fab {
    position: absolute; left: 50%; top: -32px; transform: translateX(-50%);
    width: 64px; height: 64px; border-radius: 50%;
    border: 4px solid var(--page);
    background: var(--accent); color: #fff;
    font-size: 32px; line-height: 1; font-weight: 300;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(42, 120, 214, 0.4);
  }
  /* タップ領域を円の外側にも広げる */
  .tabbar .fab::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
  /* カメラ中はシャッターであることを示す（白い縁を太く・ラベルを「撮影」に） */
  body.cam-open .tabbar .fab { border-color: #fff; box-shadow: 0 0 0 3px var(--accent), 0 6px 16px rgba(42, 120, 214, 0.4); }
  body.cam-open .tabbar .fab-label { visibility: hidden; }
  body.cam-open .tabbar .fab-slot::after { content: "撮影"; position: absolute; left: 50%; transform: translateX(-50%); bottom: 4px; font-size: 10px; font-weight: 700; color: var(--accent); white-space: nowrap; }
  .tabbar .fab-label {
    position: absolute; left: 50%; transform: translateX(-50%);
    bottom: 4px; font-size: 10px; font-weight: 700; color: var(--accent); white-space: nowrap;
  }
  main { padding-bottom: 110px; }
  #toast { bottom: 96px; }
  /* 「💬 意見」ボタン（verify-rate.js）を下タブバーの上に逃がす。
     bottom:0 の .tabbar と重なると、左端の「案件」を押せなくなるため */
  :root { --vr-fab-bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* スマホは右下に顧客画面の丸ボタン（.cd-fab）があるため左下に置く */
  #vr-fab { right: auto !important; left: 12px !important; }
}

/* 会話メモの音声入力（入力枠内・右下のアイコンボタン） */
.memo-wrap { position: relative; }
.memo-wrap textarea { width: 100%; box-sizing: border-box; }
.mic-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); /* 入力枠に対して上下の余白を均等に */
  width: 32px; height: 32px; padding: 0; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
  background: var(--surface-1); color: var(--text-primary);
}
.mic-btn:hover { background: color-mix(in srgb, var(--text-primary) 5%, var(--surface-1)); }
.mic-btn.recording {
  background: #e0245e; border-color: #e0245e; color: #fff;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 36, 94, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(224, 36, 94, 0); }
}

/* 画像選択後のトリミング（読み取り範囲の指定） */
.crop-stage {
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto;
  overflow: hidden; border-radius: 8px; touch-action: none; user-select: none; -webkit-user-select: none;
}
.crop-stage img { display: block; max-width: 100%; max-height: 62vh; }
.crop-box {
  position: absolute; border: 2px dashed #fff; border-radius: 6px; cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); touch-action: none;
}
.crop-handle {
  position: absolute; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); box-sizing: border-box;
}
.crop-handle.tl { left: -12px; top: -12px; cursor: nwse-resize; }
.crop-handle.tr { right: -12px; top: -12px; cursor: nesw-resize; }
.crop-handle.bl { left: -12px; bottom: -12px; cursor: nesw-resize; }
.crop-handle.br { right: -12px; bottom: -12px; cursor: nwse-resize; }

/* ログアウト中のロック画面（データは端末に残る。ログインするまでデータ画面を隠す） */
.lock-screen { display: flex; justify-content: center; padding: 48px 0; }
.lock-card { max-width: 420px; width: 100%; background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px; text-align: center; }
.lock-card .lock-icon { color: var(--text-muted); margin-bottom: 8px; }
.lock-card h2 { font-size: 18px; margin: 0 0 8px; }
.lock-card p { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 16px; line-height: 1.7; }
.lock-card .footnote { margin-top: 12px; }
.sync-bar .sync-note { color: var(--text-secondary); font-size: 12px; margin-left: 8px; }

/* メール相談（壁打ち） */
.mail-chat-log { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 320px; overflow-y: auto; padding: 2px 4px; overscroll-behavior: contain; }
.mc-row { display: flex; gap: 8px; align-items: flex-end; }
.mc-row.user { justify-content: flex-end; }
.mc-row.assistant { justify-content: flex-start; }
.mc-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border); background: #fff; }
.mc-name { font-size: 11px; color: var(--text-secondary); margin: 0 0 2px 4px; }
.mc.typing { display: inline-flex; gap: 4px; align-items: center; padding: 10px 14px; }
.mc.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-secondary); opacity: .4; animation: mc-blink 1.2s infinite; }
.mc.typing span:nth-child(2) { animation-delay: .2s; } .mc.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes mc-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.mc { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.mc.user { align-self: flex-end; max-width: 78%; background: var(--primary, #2f6fed); color: #fff; border-bottom-right-radius: 4px; }
.mc.assistant { align-self: flex-start; max-width: 100%; background: var(--surface-1, #f4f3f0); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.mc.assistant.muted { color: var(--text-secondary); }
.mail-chat-plan { margin-top: 10px; padding: 12px 14px; border: 1px solid #bfd3f7; background: #eef4ff; border-radius: 10px; }
.mail-chat-plan-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: #1f4fb8; }
.mail-chat-plan-body { font-size: 13px; line-height: 1.6; margin: 6px 0 8px; white-space: pre-wrap; }
.mail-chat-durable { font-size: 12px; color: #6b5a1e; background: #fff7e8; border-radius: 6px; padding: 5px 8px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.style-notes { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.style-notes li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; }

/* 署名の項目欄: 例（placeholder）は入力済みと見分けがつくよう薄く */
.sig-f::placeholder { color: var(--text-muted); opacity: 0.7; }

/* 職歴: 前の名刺は右上の×で削除できる */
.career .career-del { position: absolute; top: 8px; right: 8px; }
.career li.career-past .cardthumb { margin-top: 26px; }

/* ---- 提案分析のバックグラウンド進捗ピル（オーバーレイを閉じた後） ---- */
#ana-pill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 70;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text-primary); color: var(--page);
  border: 0; border-radius: 999px; padding: 10px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); max-width: 90vw; white-space: nowrap;
  animation: consentFade 0.25s ease;
}
#ana-pill .spinner {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: var(--page);
  animation: spin 0.8s linear infinite;
}
@media (min-width: 900px) { #ana-pill { bottom: 24px; } }
/* 分析完了の未読マーク（提案タブ） */
.sidebar nav button, .tabbar > button { position: relative; }
.sidebar nav button.has-dot::after, .tabbar > button.has-dot::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: #e5484d; box-shadow: 0 0 0 2px var(--surface-1);
}
.sidebar nav button.has-dot::after { top: 8px; right: 10px; }
.tabbar > button.has-dot::after { top: 4px; left: calc(50% + 8px); }

/* メニュー（設定）の項目一覧。スマホは1列、PC（761px以上）は2列（2026-09-22 米山指摘） */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 10px; align-content: start; }
.settings-grid .settings-row { margin: 0; min-width: 0; }
.settings-grid .footnote { grid-column: 1 / -1; }
@media (min-width: 761px) {
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .settings-grid .settings-row { height: 100%; }
}

.yaml-pre { margin: 10px 0 0; padding: 12px; background: var(--page); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; color: var(--text-secondary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
