* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  background: #f4f6fa;
  color: #1f2937;
  font-size: 16px;          /* 15→16 (+7%) base font */
  line-height: 1.55;
}

.topbar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  padding: 10px 20px; gap: 16px;
  background: #1f2937; color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.topbar h1 { margin: 0; font-size: 16px; font-weight: 700; }
.topbar .meta { display: flex; align-items: center; gap: 10px; font-size: 12px; justify-self: end; }
.topbar .center { display: flex; justify-content: center; }

.grid {
  display: grid;
  /* PC優先：4カラム構成（顧客 / 内容+現場 / 日時+予算 / 住所詳細+バックエンド+登録） */
  grid-template-columns: 1.05fr 1fr 0.95fr 1.1fr;
  gap: 10px;
  padding: 10px;
  max-width: 100vw;
  margin: 0;
  /* topbar 高さ分を引いてビューポート内に収める（縦スクロール解消） */
  height: calc(100vh - 78px);
  box-sizing: border-box;
  overflow: hidden;
}
/* iPad横（タブレット）: 2カラム×2行 */
@media (max-width: 1366px) and (min-width: 901px) {
  .grid { grid-template-columns: 1fr 1fr; height: auto; overflow: visible; }
}
/* スマホ・iPad縦: 縦積み */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; height: auto; padding: 8px; overflow: visible; }
}

.panel {
  background: white;
  border-radius: 8px;
  padding: 11px 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow-y: auto;
  font-size: 14px;       /* 13→14 (+8%) */
}
.panel h2 {
  margin: 4px 0 8px;
  font-size: 14px;       /* 13→14 */
  border-left: 3px solid #2563eb;
  padding-left: 8px;
}
.panel .lbl {
  font-size: 12px;       /* 11→12 */
  margin: 6px 0 3px;
}

/* 受電画面のチップ・ラジオ */
.panel .radios .radio,
.panel .chip {
  padding: 5px 11px;
  font-size: 13px;       /* 12→13 */
}
.panel .radios { gap: 5px; }
.panel .chips { gap: 5px; }

/* 入力欄 */
.panel input[type="text"],
.panel input[type="date"],
.panel input[type="datetime-local"],
.panel select,
.panel textarea {
  padding: 8px 11px;
  font-size: 14px;       /* 13→14 */
}
.panel .btn.big { padding: 11px; font-size: 15px; margin-top: 10px; }
.panel .preview { font-size: 13px; padding: 8px 10px; min-height: 50px; }

/* ★トークスクリプトボックス（カオル式：声に出して読むセリフ） */
.panel .talk-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 8px 10px;
  border-radius: 4px;
  margin: 6px 0 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #1f2937;
}
.panel .talk-box .talk-script {
  display: block;
  font-weight: 700;
  color: #92400e;
  margin: 2px 0 4px;
  font-size: 12.5px;
}
.panel .talk-box .talk-tip {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

/* topbar 全体の高さ調整（メーター下ラベル用に少し背を高く） */
.topbar { padding: 10px 20px 22px; }
.topbar h1 { font-size: 15px; }

/* CFO的入力状態バッジ（次にやるべきところだけが光る） */
.status-badge {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  font-size: 10px; font-weight: 700; margin-left: 6px;
  vertical-align: middle;
}
.status-badge.next {
  background: #fef3c7; color: #92400e;
}
.status-badge.todo {
  background: #f3f4f6; color: #9ca3af;
}
.status-badge.done {
  background: #d1fae5; color: #065f46;
}

/* 「次に入力すべき」フィールド単位のハイライト（要素を直接囲む） */
.step-active {
  outline: 3px solid #f59e0b !important;
  outline-offset: 3px;
  border-radius: 6px;
  animation: stepPulse 1.4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11, 0.55); }
  50%      { box-shadow: 0 0 0 10px rgba(245,158,11, 0); }
}

/* メーターゲージ（中央配置・大きめ） */
.cfo-meter {
  display: flex; gap: 4px;
  vertical-align: middle;
}
.cfo-meter-cell {
  width: 60px; height: 14px; border-radius: 3px;
  background: rgba(255,255,255,0.15);
  transition: background .3s;
  position: relative;
}
.cfo-meter-cell.filled { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.5); }
.cfo-meter-cell.next   { background: #fcd34d; animation: meterBlink 1s infinite; box-shadow: 0 0 8px rgba(252,211,77,.7); }
.cfo-meter-cell::after {
  content: attr(data-label);
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
@keyframes meterBlink {
  50% { opacity: 0.4; }
}

/* 全体のCFOステータスバー（topbar中央・大きめ） */
.cfo-bar {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; padding: 8px 18px;
  background: rgba(255,255,255,0.08); color: white;
  border-radius: 8px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.1);
}
.cfo-bar .label { font-size: 11px; opacity: .7; }
.cfo-bar .ok { color: #6ee7b7; font-size: 13px; }
.cfo-bar .ng { color: #fcd34d; font-size: 13px; }
.cfo-bar #cfo-progress { font-size: 13px; font-weight: 700; }
.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #374151;
  border-left: 4px solid #2563eb;
  padding-left: 10px;
}
.panel h2 + .lbl, .panel h2 + .row, .panel h2 + #services { margin-top: 0; }

.lbl {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin: 12px 0 4px;
  font-weight: 500;
}
.lbl-inline { color: #6b7280; font-size: 12px; margin-right: 8px; }
.req { color: #dc2626; }

input[type="text"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: white;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
textarea { resize: vertical; }

.row { display: flex; gap: 8px; align-items: stretch; }
.col { flex: 1; }
.row > input { flex: 1; }

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .05s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #d1d5db !important; cursor: not-allowed; color: #6b7280 !important; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-success { background: #059669; color: white; }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: white; border: 1px solid rgba(255,255,255,.3); padding: 6px 10px; font-size: 12px; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn.big { width: 100%; padding: 12px; font-size: 15px; margin-top: 14px; }

.addr-block {
  background: #f9fafb;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
}
.addr-line { padding: 4px 0; }
.addr-line b { font-size: 15px; color: #111827; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.chip:hover { border-color: #2563eb; }
.chip.active {
  background: #2563eb; color: white; border-color: #2563eb;
}

.msg { font-size: 13px; padding: 6px 0; min-height: 1em; }
.msg.error { color: #dc2626; }
.msg.success { color: #059669; }
.msg.info { color: #2563eb; }

.provider-list { list-style: none; padding: 0; margin: 0; }
.provider-list li {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.provider-list li:hover { border-color: #2563eb; background: #f0f7ff; }
.provider-list li.selected {
  border-color: #059669; background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(5,150,105,.2);
}
.prov-name {
  font-weight: 700; font-size: 15px; color: #111827;
  display: flex; justify-content: space-between; align-items: center;
}
.prov-score {
  background: #fbbf24; color: #78350f;
  padding: 2px 8px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.prov-meta { font-size: 13px; color: #4b5563; margin-top: 4px; }
.prov-services { font-size: 12px; color: #6b7280; margin-top: 4px; }
.prov-note {
  font-size: 12px; color: #b91c1c;
  margin-top: 4px; padding: 4px 8px;
  background: #fef2f2; border-radius: 4px;
}

.selected {
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 14px;
  min-height: 40px;
  border: 1px dashed #d1d5db;
}
.selected.has-value { background: #ecfdf5; border-style: solid; border-color: #059669; }

/* ラジオ（大ジャンル/希望時期/予算感） */
.radios { display: flex; flex-wrap: wrap; gap: 6px; }
.radios .radio {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 20px;
  background: white; cursor: pointer; font-size: 13px;
  user-select: none; transition: all .15s;
}
.radios .radio:hover { border-color: #2563eb; }
.radios .radio input[type="radio"] { display: none; }
.radios .radio:has(input:checked) {
  background: #2563eb; color: white; border-color: #2563eb; font-weight: 600;
}

/* セレクト（オペレーター） */
select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 15px; font-family: inherit; background: white;
}
select:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* 依頼詳細プレビュー */
.preview {
  background: #f9fafb; border: 1px dashed #d1d5db; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: #374151;
  font-family: inherit; white-space: pre-wrap; margin: 0;
  min-height: 60px; line-height: 1.6;
}
.prov-base { font-size: 12px; color: #6b7280; margin-top: 4px; }
.prov-badges { display: flex; gap: 6px; align-items: center; }
.prov-route {
  background: #dbeafe; color: #1e40af;
  padding: 2px 8px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.prov-route-na { background: #f3f4f6; color: #6b7280; }

/* ===== V3.3: 不用品回収・品目クリック選択UI ===== */
.disposal-cat { margin-bottom: 10px; }
.disposal-cat-h {
  font-size: 12px; font-weight: 700; color: #065f46;
  background: #d1fae5; border-left: 4px solid #10b981;
  padding: 4px 10px; margin-bottom: 6px; border-radius: 4px;
}
.disposal-items-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.disposal-item {
  border: 2px solid #e5e7eb; border-radius: 8px;
  padding: 8px 10px; background: #fff;
  cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 6px;
  user-select: none;
}
.disposal-item:hover { border-color: #10b981; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.disposal-item.active {
  border-color: #10b981; background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16,185,129,.2);
}
.disposal-item-name {
  font-size: 13px; font-weight: 700; color: #1f2937;
  text-align: center;
}
.disposal-stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.disposal-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #10b981; background: #fff; color: #065f46;
  font-weight: 700; font-size: 16px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0;
  transition: all .12s;
}
.disposal-btn:hover { background: #10b981; color: #fff; }
.disposal-btn:active { transform: scale(.92); }
.disposal-qty {
  display: inline-block; min-width: 22px; text-align: center;
  font-weight: 700; font-size: 15px; color: #065f46;
}
.disposal-unit { font-size: 11px; color: #6b7280; }

/* モバイル: 1カラム */
@media (max-width: 600px) {
  .disposal-items-grid { grid-template-columns: 1fr; }
}
