/* =========================================================
 * style.css — 営業支援システム試作版（一画面タブレイアウト）
 * 配色トークンは検証済みパレット（light mode）に準拠
 * ========================================================= */

:root {
  color-scheme: light;
  /* サーフェス・インク */
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  /* カテゴリ色（固定順・検証済み） */
  --cat-1: #2a78d6; /* ファッション手袋 */
  --cat-2: #eb6834; /* UV・サマー手袋 */
  --cat-3: #1baf7a; /* 作業・スポーツ手袋 */
  --cat-4: #eda100; /* 靴下・レッグウェア */
  --cat-5: #e87ba4; /* ニット帽・マフラー */
  /* アクセント */
  --accent: #2a78d6;
  --accent-dark: #1c5cab;
  --good: #006300;
  --warn-bg: #fdf3e4;
  --ai-grad: linear-gradient(135deg, #2a78d6, #4a3aa7);
  --header-h: 54px;
}

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

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden; /* ページ全体はスクロールさせない */
}

/* ---------- ヘッダー ---------- */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 7px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}
header .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ai-grad);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
header h1 { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
header .sub { font-size: 11px; color: var(--ink-2); line-height: 1.2; }
.badge-proto {
  margin-left: auto;
  font-size: 11.5px; font-weight: 600;
  color: var(--accent-dark);
  background: #e9f1fb;
  border: 1px solid #c5daf3;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}

/* ---------- レイアウト（一画面固定） ---------- */
.app {
  display: grid;
  grid-template-columns: 262px 1fr;
  gap: 12px;
  height: calc(100vh - var(--header-h));
  padding: 12px 16px;
  max-width: 1440px;
  margin: 0 auto;
}

aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
aside h2 {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.customer-scroll { overflow-y: auto; min-height: 0; }

main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* ---------- 顧客リスト ---------- */
.customer-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.customer-item + .customer-item { margin-top: 7px; }
.customer-item:hover { border-color: var(--accent); }
.customer-item.active {
  border-color: var(--accent);
  background: #eef4fc;
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.customer-item .name { font-weight: 700; font-size: 13px; }
.customer-item .meta { font-size: 11px; color: var(--ink-2); margin-top: 1px; }
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  padding: 0 5px; margin-right: 6px;
}
.rank-A { background: #1c5cab; }
.rank-B { background: #52514e; }
.rank-C { background: #898781; }

/* ---------- 条件バー ---------- */
.control-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  flex-shrink: 0;
}
.control-bar label { font-size: 10.5px; color: var(--muted); display: block; }
.control-bar select {
  font-size: 13.5px; padding: 4px 10px;
  border: 1px solid var(--baseline); border-radius: 8px;
  background: #fff; color: var(--ink);
  min-width: 130px;
}
.weather-box {
  flex: 1; min-width: 220px;
  background: #eef4fc; border: 1px solid #c5daf3; border-radius: 8px;
  padding: 5px 12px; font-size: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.weather-box .tag {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  background: #fff; border: 1px solid #c5daf3; color: var(--accent-dark);
  border-radius: 999px; padding: 0 8px; margin-right: 4px;
}
.btn-ai {
  background: var(--ai-grad);
  color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  padding: 9px 22px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 2px 8px rgba(42, 120, 214, 0.35);
  transition: transform 0.1s, box-shadow 0.1s;
  white-space: nowrap;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(42, 120, 214, 0.45); }
.btn-ai:disabled { opacity: 0.55; cursor: wait; transform: none; }

/* ---------- タブ ---------- */
.tabs {
  display: flex; align-items: center; gap: 4px;
  margin-top: 10px;
  flex-shrink: 0;
  border-bottom: 2px solid var(--grid);
  overflow-x: auto; /* 画面が狭い時はタブバー内で横スクロール */
  scrollbar-width: thin;
}
.tab {
  border: none; background: none;
  font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 8px 14px 7px;
  cursor: pointer;
  border-radius: 9px 9px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.tab:hover:not(:disabled) { background: #f0f4fa; color: var(--accent-dark); }
.tab.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  background: #eef4fc;
}
.tab:disabled { opacity: 0.4; cursor: not-allowed; }
.tab-actions { margin-left: auto; display: flex; gap: 6px; padding-bottom: 4px; }
.btn-sub {
  font-size: 12px; padding: 4px 11px;
  border: 1px solid var(--baseline); border-radius: 7px;
  background: #fff; color: var(--ink-2); cursor: pointer;
}
.btn-sub:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- パネル（内部スクロール） ---------- */
.panels {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
}
.panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 14px 18px;
}
.panel.active { display: block; }

.disclaimer {
  flex-shrink: 0;
  margin-top: 6px;
  font-size: 10.5px; color: var(--muted);
  text-align: center;
}

/* ---------- 顧客詳細（上段2カラム＋下段全幅チャート） ---------- */
#panel-info.active { display: flex; flex-direction: column; }
#customerDetail { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.detail-top {
  display: grid;
  grid-template-columns: minmax(320px, 5fr) minmax(300px, 4fr);
  gap: 8px 28px;
  flex-shrink: 0;
}
@media (max-width: 1000px) { .detail-top { grid-template-columns: 1fr; } }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 12.5px; }
.detail-grid dt { color: var(--muted); font-size: 10.5px; }
.detail-grid dd { font-weight: 600; }

.reflection {
  background: var(--warn-bg);
  border: 1px solid #f0dcbb;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  display: flex; gap: 8px; align-items: baseline;
}
.reflection + .reflection { margin-top: 5px; }
.reflection .m {
  flex-shrink: 0;
  font-weight: 700; font-size: 10.5px; color: #8a5a00;
  background: #fff; border-radius: 6px; padding: 0 6px;
  border: 1px solid #f0dcbb;
}

/* ---------- チャート ---------- */
.chart-wrap { margin-top: 10px; }
.chart-wrap:first-child { margin-top: 0; }
/* 下段の実績チャート: 余白を使って伸びるが横長比率を保つ（高さ上限あり・下端に固定） */
.chart-wrap.grow {
  flex: 1; min-height: 150px; max-height: 380px;
  display: flex; flex-direction: column;
  margin-top: auto; padding-top: 14px;
}
.chart-wrap.grow .bar-chart { flex: 1; height: auto; min-height: 120px; }
.chart-wrap.grow .chart-title,
.chart-wrap.grow .x-labels { flex-shrink: 0; }
.chart-title { font-size: 11.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.bar-chart {
  display: flex; align-items: flex-end; gap: 5px;
  height: 120px;
  border-bottom: 1px solid var(--baseline);
  position: relative;
  background:
    repeating-linear-gradient(to top, transparent 0 39px, var(--grid) 39px 40px);
}
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.bar {
  width: 70%;
  max-width: 48px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: opacity 0.1s;
}
.bar-col:hover .bar { opacity: 0.75; }
.bar-col .val {
  position: absolute; top: -16px;
  font-size: 9.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.x-labels { display: flex; gap: 5px; margin-top: 3px; }
.x-labels span {
  flex: 1; text-align: center;
  font-size: 9px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 積み上げ横棒（カテゴリ構成） */
.stack-bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface); }
.stack-seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
  min-width: 0; overflow: hidden; white-space: nowrap;
}
.stack-seg.dark-label { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; }
.legend span { font-size: 10.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.tooltip {
  position: fixed;
  background: var(--ink); color: #fff;
  font-size: 11.5px; line-height: 1.5;
  padding: 6px 10px; border-radius: 7px;
  pointer-events: none;
  z-index: 100;
  display: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- ローディングオーバーレイ ---------- */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(252, 252, 251, 0.88);
  border-radius: 0 0 12px 12px;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.loading { text-align: center; }
.spinner {
  width: 42px; height: 42px; margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid #e0eafa;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .step { font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* ---------- AI結果 ---------- */
.result-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  font-size: 11.5px; color: var(--ink-2);
  padding: 7px 12px;
  background: linear-gradient(135deg, #eef4fc, #f2effc);
  border: 1px solid #c5daf3;
  border-radius: 10px;
  margin-bottom: 10px;
}
.result-meta .engine { font-weight: 700; color: var(--accent-dark); }
.conf-meter { display: inline-flex; align-items: center; gap: 6px; }
.conf-meter .track { width: 80px; height: 6px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.conf-meter .fill { height: 100%; background: var(--accent); border-radius: 999px; }

.headline {
  font-size: 13.5px; font-weight: 700;
  background: #eef4fc; border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 8px 13px; margin-bottom: 8px;
}
.point { display: flex; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed var(--grid); font-size: 12.5px; }
.point:last-child { border-bottom: none; }
.point .icon { flex-shrink: 0; font-size: 16px; }
.point .t { font-weight: 700; font-size: 12px; }
.point .x { color: var(--ink-2); font-size: 12px; }

/* おすすめ商品 */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.prod-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 13px; background: #fff;
  position: relative;
}
.prod-card.is-new { border-color: #e87ba4; }
.new-tag {
  position: absolute; top: -9px; right: 10px;
  background: #d55181; color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 999px; padding: 1px 9px;
}
.prod-card .code { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prod-card .pname { font-weight: 700; font-size: 13px; margin: 1px 0 2px; }
.prod-card .pmeta { font-size: 11.5px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
.prod-card .price { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.score-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.score-row .track { flex: 1; height: 6px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.score-row .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.score-row b { font-size: 11px; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.reasons { font-size: 11px; color: var(--ink-2); padding-left: 2px; }
.reasons li { list-style: none; padding-left: 14px; position: relative; margin-top: 1px; }
.reasons li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }

/* 陳列提案 */
.theme-banner {
  background: var(--ai-grad); color: #fff;
  border-radius: 10px; padding: 8px 14px;
  font-size: 13.5px; font-weight: 700;
  margin-bottom: 10px;
}
.zone { border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; background: #fff; }
.zone + .zone { margin-top: 8px; }
.zone .zt { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.zone .zt .zicon { font-size: 15px; }
.zone .chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.chip {
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--baseline); border-radius: 999px;
  padding: 2px 10px; background: var(--surface);
}
.chip.new { border-color: #d55181; color: #a82d5c; background: #fdf0f5; }
.zone .zn { font-size: 11.5px; color: var(--ink-2); }

/* 営業台本 */
.script-sec { display: flex; gap: 11px; }
.script-sec + .script-sec { margin-top: 9px; }
.script-sec .marker {
  flex-shrink: 0; width: 4px; border-radius: 999px; background: var(--accent);
  opacity: 0.5;
}
.script-sec .st { font-weight: 700; font-size: 12px; color: var(--accent-dark); margin-bottom: 2px; }
.script-sec .sx {
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 12px 12px 12px;
  padding: 8px 13px;
}

/* ---------- SFA（商談記録・名刺スキャン） ---------- */
.sfa-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  align-items: start;
}
@media (max-width: 1000px) { .sfa-cols { grid-template-columns: 1fr; } }
.sfa-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.sfa-count { font-size: 11px; font-weight: 600; color: var(--accent-dark); background: #e9f1fb; border-radius: 999px; padding: 1px 8px; }

/* 商談履歴タイムライン */
.meet-item {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; background: #fff;
  padding: 8px 12px; font-size: 12px;
}
.meet-item + .meet-item { margin-top: 7px; }
.meet-item .head { display: flex; gap: 8px; align-items: center; margin-bottom: 3px; }
.meet-item .date { font-weight: 700; font-variant-numeric: tabular-nums; }
.meet-kind {
  font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 0 8px;
  background: #eef4fc; color: var(--accent-dark); border: 1px solid #c5daf3;
}
.meet-item .person { color: var(--ink-2); font-size: 11px; }
.meet-item .note { color: var(--ink-2); }
.meet-item .next {
  margin-top: 4px; font-size: 11.5px; font-weight: 600; color: #8a5a00;
  background: var(--warn-bg); border-radius: 6px; padding: 2px 8px; display: inline-block;
}
.meet-empty { color: var(--muted); font-size: 12px; padding: 12px 4px; }

/* 入力フォーム */
.sfa-form {
  margin-top: 12px; border: 1px dashed var(--baseline); border-radius: 10px;
  padding: 10px 12px; background: var(--surface);
}
.sfa-form-title { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.sfa-form-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.sfa-form input[type="date"], .sfa-form input[type="text"], .sfa-form select,
.sfa-form textarea, #meetingRaw {
  font-family: inherit; font-size: 12.5px;
  border: 1px solid var(--baseline); border-radius: 8px;
  padding: 6px 10px; background: #fff; color: var(--ink);
}
.sfa-form textarea, #meetingRaw { width: 100%; resize: vertical; }
#meetingRaw { display: block; }
.btn-sub.strong { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-sub.strong:hover { background: var(--accent-dark); color: #fff; }
.btn-ai.small { font-size: 12.5px; padding: 6px 14px; border-radius: 8px; }

/* AI要約結果 */
.sum-box { margin-top: 12px; }
.sum-meta { font-size: 11px; color: var(--ink-2); margin-bottom: 8px; }
.sum-sec {
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  padding: 7px 11px; font-size: 12px;
}
.sum-sec + .sum-sec { margin-top: 6px; }
.sum-sec .h { font-weight: 700; font-size: 11.5px; color: var(--accent-dark); margin-bottom: 2px; }
.sum-sec ul { padding-left: 16px; }
.sum-sec li { margin-top: 1px; }
.sum-temp {
  margin-top: 8px; font-size: 12.5px; font-weight: 700;
  background: #eef4fc; border: 1px solid #c5daf3; border-radius: 8px;
  padding: 6px 11px; display: inline-block;
}

/* 名刺スキャン */
.scan-box {
  border: 1px dashed var(--baseline); border-radius: 10px;
  padding: 12px; background: var(--surface);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.scan-note { font-size: 10.5px; color: var(--muted); width: 100%; }
.scan-loading { display: flex; align-items: center; gap: 10px; padding: 14px 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.spinner.mini { width: 22px; height: 22px; border-width: 3px; margin: 0; }
.card-result {
  margin-top: 12px; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: #fff;
}
.card-result .conf { font-size: 11px; color: var(--accent-dark); font-weight: 700; margin-bottom: 8px; }
.card-grid { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; font-size: 12.5px; align-items: center; }
.card-grid label { font-size: 11px; color: var(--muted); text-align: right; }
.card-grid input {
  font-family: inherit; font-size: 12.5px;
  border: 1px solid var(--baseline); border-radius: 7px;
  padding: 4px 9px; background: #fff; color: var(--ink); width: 100%;
}
.card-result .actions-row { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
.card-preview { max-width: 180px; max-height: 110px; border-radius: 8px; border: 1px solid var(--border); margin-top: 10px; }

/* カメラ撮影オーバーレイ */
.camera-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.84);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.camera-frame { width: min(560px, 94vw); }
.camera-frame video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; background: #000;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.camera-guide { text-align: center; color: #fff; font-size: 12.5px; margin-top: 10px; }
.camera-controls { display: flex; justify-content: center; align-items: center; gap: 26px; margin-top: 12px; }
.cam-shutter {
  width: 58px; height: 58px; border-radius: 50%;
  border: 4px solid #fff; background: #e34948;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}
.cam-shutter:hover { background: #d03b3b; }

/* 人脈カード */
.contact-card {
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  padding: 9px 13px; font-size: 12px;
  display: flex; gap: 11px; align-items: center;
}
.contact-card + .contact-card { margin-top: 7px; }
.contact-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--ai-grad); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.contact-card .cname { font-weight: 700; font-size: 13px; }
.contact-card .cmeta { color: var(--ink-2); font-size: 11px; }
.contact-card .cdate { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }

.hidden { display: none !important; }

/* ---------- スマホ版レイアウト（body.mobile で切り替え） ---------- */
.view-toggle { margin-left: 10px; white-space: nowrap; }

body.mobile .app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(412px, 100%);
  padding: 10px;
}
/* 広い画面でスマホ版を見る時だけ端末フレーム風に（iPhone比率 390×844 ≒ 19.5:9） */
@media (min-width: 700px) {
  body.mobile .app {
    margin: 10px auto;
    width: min(390px, 100%);
    height: min(844px, calc(100vh - var(--header-h) - 20px));
    border: 6px solid #1d1d1f;
    border-radius: 30px;
    background: var(--page);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  }
}
/* 顧客一覧 → 横スクロールのカード列 */
body.mobile aside { flex-shrink: 0; padding: 8px; }
body.mobile aside h2 { display: none; }
body.mobile .customer-scroll {
  display: flex; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
body.mobile .customer-item { min-width: 190px; flex-shrink: 0; }
body.mobile .customer-item + .customer-item { margin-top: 0; }
body.mobile .customer-item .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 条件バー: グリッドで確定配置（1行目=月選択+ボタン / 2行目=天候全幅） */
body.mobile .control-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: end;
  padding: 8px 10px;
}
body.mobile .weather-box {
  grid-column: 1 / -1;
  flex: none;
  width: auto;
  min-width: 0;
  font-size: 11px;
  padding: 5px 10px;
}
body.mobile .btn-ai { width: 100%; justify-content: center; font-size: 13px; padding: 9px 10px; }
body.mobile .control-bar select { width: 100%; }
/* タブ */
body.mobile .tabs { margin-top: 8px; }
body.mobile .tab { font-size: 11.5px; padding: 7px 9px 6px; }
body.mobile .tab-actions { display: none; }
/* パネル内は1カラム化 */
body.mobile .panel { padding: 12px; }
body.mobile .detail-top { grid-template-columns: 1fr; gap: 10px; }
body.mobile .sfa-cols { grid-template-columns: 1fr; gap: 12px; }
body.mobile .prod-grid { grid-template-columns: 1fr; }
body.mobile .chart-wrap.grow { min-height: 130px; max-height: 230px; flex: none; height: 230px; margin-top: 12px; }
body.mobile .x-labels span:nth-child(even) { color: transparent; } /* ラベル間引き */
body.mobile .bar { max-width: 20px; }
body.mobile .disclaimer { display: none; }
/* 狭い実機ではヘッダーも簡略化 */
@media (max-width: 700px) {
  .badge-proto { display: none; }
  header .sub { display: none; }
}

/* ---------- 印刷（全タブを通しで出力） ---------- */
@media print {
  body { height: auto; overflow: visible; background: #fff; }
  header, aside, .control-bar, .tabs, .disclaimer { display: none !important; }
  .app { display: block; height: auto; padding: 0; }
  .panels { border: none; }
  .panel { display: block !important; height: auto; overflow: visible; padding: 10px 0; page-break-inside: avoid; }
  #panel-info, #panel-meet, #panel-card { display: none !important; }
  .loading-overlay { display: none !important; }
}
