*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  border-top: 14px solid #83B2D0;
  border-bottom: 15px solid #83B2D0;
  background: #FDFCF8;
  color: #57534E;
  font-family: "YuGothic","游ゴシック体","Yu Gothic","游ゴシック",Hiragino Sans,"ヒラギノ角ゴシック","Meiryo",sans-serif;
}
h1 { letter-spacing: 2px; font-weight: bold; font-size: 22px; }
h1 span { color: #83B2D0; }
h2 { font-size: 15px; font-weight: 500; color: #292524; display: flex; align-items: center; gap: 8px; margin: 0; }

.page { max-width: 65rem; margin: 0 auto; padding: 6px; }
@media (min-width: 768px) { .page { padding: 10px; } }
@media (min-width: 1280px) { .page { padding: 14px; } }

.site-header { text-align: center; padding-bottom: 16px; border-bottom: 1px solid #E7E5E4; margin-bottom: 12px; }
.site-header img { height: auto; max-width: 150px; margin-bottom: 16px; }
@media (min-width: 768px) { .site-header img { max-width: 200px; } }
.site-header p { font-size: 12px; color: #A8A29E; letter-spacing: 0.05em; }

/* ヒーロー画像 */
.hero-image {
  margin: 0 0 12px;
  border-radius: 2px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.card { background: #fff; border: 1px solid #E7E5E4; border-radius: 2px; padding: 8px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
@media (min-width: 768px) { .card { padding: 10px; } }
.card-title { border-bottom: 1px solid #F5F5F4; padding-bottom: 12px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

/* 見出しは折り返さない（1行固定・長すぎる場合のみ省略） */
.card-title h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}

/* スマホ：見出しとアクションを縦積みに */
@media (max-width: 640px) {
  .card-title {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .card-title h2 {
    flex: 1 1 100%;
    width: 100%;
  }
  .card-title-actions,
  .card-title > .hist-load-area {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
  }
  .card-title-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
}

/* アップロード（一体型） */
.upload-zone {
  border: 2px dashed #D6D3D1;
  border-radius: 2px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: #FAFAF9;
  transition: border-color .15s, background .15s;
  overflow: hidden;
  position: relative;
}
.upload-zone:hover { border-color: #83B2D0; background: #F0F7FB; }
.upload-zone.on { border-color: #83B2D0; background: #EAF4FB; }
.upload-zone.has-image {
  padding: 0;
  border: 1px solid #E7E5E4;
  background: transparent;
}
.upload-zone.has-image:hover { border-color: #83B2D0; }
.upload-icon { width: 32px; height: 32px; margin: 0 auto 10px; color: #D6D3D1; }
.upload-icon svg { width: 32px; height: 32px; }
.upload-text { font-size: 13px; color: #78716C; }
.upload-hint { font-size: 11px; color: #A8A29E; margin-top: 4px; }
input[type="file"] { display: none; }

/* お部屋写真サブヘッダー */
.upload-subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.upload-subhead-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #292524;
}
.upload-subhead-title svg { color: #83B2D0; flex-shrink: 0; }
.upload-subhead-note {
  font-size: 11px;
  color: #A8A29E;
}

/* 手書き間取り図セクション */
.sketch-section {
  margin-top: 14px;
  border: 1px solid #E8C68F;
  border-radius: 3px;
  background: #FFFCF3;
  overflow: hidden;
}
.sketch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #FDF6E3;
  border-bottom: 1px solid #E8C68F;
}
.sketch-head-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #6F5F3F;
}
.sketch-head-title svg { color: #D8A85C; flex-shrink: 0; }
.sketch-head-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #D8A85C;
  border-radius: 10px;
  color: #8F6828;
  font-size: 10px;
  font-weight: 600;
}
.sketch-body {
  padding: 14px;
}
.sketch-help {
  margin: 0 0 12px;
  font-size: 12px;
  color: #57534E;
  line-height: 1.7;
}
.sketch-help strong { color: #292524; font-weight: 600; }
.sketch-example-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding: 2px 9px;
  background: #fff;
  border: 1px solid #D8A85C;
  border-radius: 10px;
  color: #8F6828;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  vertical-align: 1px;
}
.sketch-example-btn:hover {
  background: #FDEBBF;
  color: #6F5F3F;
}
.sketch-upload-zone {
  border: 2px dashed #D8A85C;
  border-radius: 2px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
  overflow: hidden;
  position: relative;
}
.sketch-upload-zone:hover { border-color: #C79746; background: #FDF6E3; }
.sketch-upload-zone.on { border-color: #C79746; background: #FDEBBF; }
.sketch-upload-zone.has-image {
  padding: 0;
  border: 1px solid #E7E5E4;
  background: transparent;
}
.sketch-upload-zone .upload-icon { color: #D8A85C; }
#sketchPrev { display: none; position: relative; }
#sketchPrev.prev-wrap { display: none; }
.sketch-upload-zone.has-image #sketchPrev { display: block; }
.sketch-upload-zone.has-image #sketchPlaceholder { display: none; }
#sketchPrevImg { width: 100%; display: block; }

/* 寸法読み取り結果バッジ */
.sketch-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #E7E5E4;
  background: #FAFAF9;
  color: #57534E;
}
.sketch-result.loading {
  background: #FDF6E3;
  border-color: #F0C878;
  color: #6F5F3F;
}
.sketch-result.success {
  background: #ECFDF3;
  border-color: #16A34A;
  color: #1A6B36;
}
.sketch-result.error {
  background: #FEF2F2;
  border-color: #E05252;
  color: #B91C1C;
}
.sketch-result-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16A34A;
  color: #fff;
}
.sketch-result.loading .sketch-result-icon { background: #F0C878; }
.sketch-result.error .sketch-result-icon { background: #E05252; }
.sketch-result-text { flex: 1; }
.sketch-result-text strong { font-weight: 700; }
.sketch-result-warn {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: #FDF6E3;
  color: #8F6828;
  border-radius: 2px;
  font-size: 10px;
}
.sketch-room-label {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  background: #16A34A;
  color: #fff;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
}
.calib-result-base {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: #78716C;
}
.calib-result-debug {
  margin-top: 4px;
  font-size: 11px;
  color: #A8A29E;
  font-weight: normal;
}

/* 記入例モーダル内の図とTips */
.sketch-example-figure {
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 4px;
  padding: 12px;
  text-align: center;
}
.sketch-example-figure svg {
  max-width: 320px;
  width: 100%;
  height: auto;
}
.sketch-tips {
  background: #F0F9FF;
  border: 1px solid #BAE0F0;
  border-radius: 3px;
  padding: 12px 14px;
}
.sketch-tip-title {
  font-size: 12px;
  font-weight: 600;
  color: #2E6A8A;
  margin-bottom: 6px;
}
.sketch-tips ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #44403C;
  line-height: 1.8;
}
.sketch-tips ul li strong { color: #2E6A8A; font-weight: 600; }

/* STEP1 内の俯瞰図生成ボタン */
.btn-genmap-step1 {
  margin-top: 16px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
}
.btn-genmap-step1:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@keyframes pulseAttention {
  0%   { box-shadow: 0 0 0 0 rgba(131, 178, 208, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(131, 178, 208, 0); }
  100% { box-shadow: 0 0 0 0 rgba(131, 178, 208, 0); }
}
.btn-genmap-step1.pulse-attention {
  animation: pulseAttention 1.4s ease-out 2;
}

/* プレビュー（ゾーン内） */
#prevImg { width: 100%; display: block; }
.preview-rm {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 1px solid #E7E5E4;
  color: #78716C;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-rm:hover { background: #fff; color: #292524; }

/* ボタン */
.btn-primary { width: 100%; padding: 14px; background: #83B2D0; color: #fff; border: none; border-radius: 2px; font-size: 14px; font-weight: 500; letter-spacing: 0.1em; cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.btn-primary:hover { background: #6A9AB8; }
.btn-primary:disabled { background: #D6D3D1; color: #A8A29E; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; background: #D6E9F5; color: #2E6A8A; border: none; border-radius: 2px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; transition: background .15s; }
.btn-sm:hover { background: #C0D9EC; }
.btn-sm:disabled { opacity: .5; cursor: not-allowed; }

/* ステータス */
.status { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #78716C; padding: 14px 0; }
.spin { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid #E7E5E4; border-top-color: #83B2D0; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* 結果 */
.result-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-label { font-size: 12px; color: #A8A29E; }
.dl-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #83B2D0; color: #fff; border-radius: 2px; border: none; font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .15s; font-family: inherit; }
.dl-btn:hover { background: #6A9AB8; }
.result-img { width: 100%; display: block; border-radius: 2px; border: 1px solid #E7E5E4; }
.preview-area { min-height: 200px; background: #FAFAF9; border: 1px solid #E7E5E4; border-radius: 2px; display: flex; align-items: center; justify-content: center; color: #D6D3D1; font-size: 11px; letter-spacing: 2px; }

/* エラー */
.err-box { border-radius: 2px; overflow: hidden; border: 1px solid #F0E6E1; margin-top: 12px; }
.err-body { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: #FAF3F0; }
.err-title { font-size: 13px; font-weight: bold; color: #7C4A3A; margin-bottom: 3px; }
.err-detail { font-size: 11px; color: #8C5E4D; line-height: 1.6; }
.err-action { display: flex; gap: 8px; padding: 10px 14px; background: #FDF6F4; border-top: 1px solid #F0E6E1; font-size: 11px; color: #7C4A3A; }
.err-action strong { color: #83B2D0; flex-shrink: 0; }

/* 商品グリッド */
.cand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .cand-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) { .cand-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 900px) { .cand-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; } }
.cand-item { border: 1.5px solid #E7E5E4; border-radius: 2px; overflow: hidden; background: #fff; cursor: pointer; transition: border-color .12s; }
.cand-item:hover { border-color: #83B2D0; }
.cand-item.selected { border-color: #83B2D0; box-shadow: 0 0 0 1px #83B2D0; }
.cand-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cand-item-name { font-size: 10px; color: #78716C; padding: 4px 6px; line-height: 1.4; display: block; }
.cand-actions { display: flex; gap: 4px; padding: 0 6px 6px; }
@media (min-width: 900px) { .cand-actions { padding: 0 4px 4px; } }
.cand-add { flex: 1; padding: 5px 4px; border: 1px solid #83B2D0; border-radius: 2px; background: transparent; color: #2E6A8A; font-size: 10px; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 2px; }
.cand-add:hover { background: #EAF4FB; }
.cand-add.in-queue-btn { background: #E8F4EC; color: #3D7A54; border-color: #8FC0A0; }
.cand-add.in-queue-btn:hover { background: #D8ECDE; }
.cand-add:disabled, .cand-add.btn-disabled-overlay { opacity: 0.4; cursor: not-allowed; }
.cand-item.in-queue { box-shadow: 0 0 0 2px #8FC0A0 inset; }
.cand-link { padding: 5px 6px; border: 1px solid #E7E5E4; border-radius: 2px; background: transparent; color: #78716C; font-size: 10px; cursor: pointer; display: flex; align-items: center; text-decoration: none; }
.cand-link:hover { background: #F5F5F4; }

/* ── バッチ配置キューバー（画面下部フローティング） ── */
.batch-queue-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 950;
  background: #FAF8F3;
  color: #2A2219;
  border: 1px solid #C0B4A0;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(80, 70, 60, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  animation: batchBarFadeIn .25s ease;
}
@keyframes batchBarFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.batch-queue-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 920px;
  flex-wrap: wrap;
}
.batch-queue-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.batch-queue-left svg { color: #83B2D0; flex-shrink: 0; }
.batch-queue-label { font-size: 13px; font-weight: 500; color: #2A2219; white-space: nowrap; }
.batch-queue-label span { color: #4A849E; font-weight: 700; margin: 0 2px; }
.batch-queue-names {
  font-size: 11px;
  color: #78716C;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.batch-queue-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.batch-queue-right .btn-ghost {
  background: transparent;
  color: #78716C;
  border: 1px solid #D6D3D1;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.batch-queue-right .btn-ghost:hover { background: #F5F5F4; color: #2A2219; }
.batch-queue-right .btn-primary {
  background: #83B2D0;
  color: #fff;
  border: 1px solid #83B2D0;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.batch-queue-right .btn-primary:hover { background: #6FA3C4; }

@media (max-width: 640px) {
  .batch-queue-bar { left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; }
  .batch-queue-names { display: none; }
  .batch-queue-label { font-size: 12px; }
}

/* ── 汎用モーダル（confirm-dialog-overlay でラップ） ── */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalOverlayFadeIn .2s ease;
}
@keyframes modalOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-dialog {
  background: #fff;
  border-radius: 6px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  animation: modalBoxSlideIn .25s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
@keyframes modalBoxSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.confirm-dialog-head {
  padding: 18px 20px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #292524;
  text-align: center;
}
.confirm-dialog-note {
  padding: 0 20px 12px;
  font-size: 11px;
  color: #78716C;
  text-align: center;
  line-height: 1.6;
}
.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px 16px;
  justify-content: flex-end;
}
.confirm-dialog-actions .btn-cancel {
  padding: 9px 18px;
  border: 1px solid #D6D3D1;
  background: white;
  color: #57534E;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.confirm-dialog-actions .btn-cancel:hover { background: #F5F5F4; }
.confirm-dialog-actions .btn-confirm {
  padding: 9px 20px;
  border: 1px solid #83B2D0;
  background: #83B2D0;
  color: white;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.confirm-dialog-actions .btn-confirm:hover { background: #6FA3C4; border-color: #6FA3C4; }

/* ── 配置一覧ダイアログ（「まとめて配置する」ボタンから表示） ── */
.batch-dialog { max-width: 520px; width: 96vw; padding: 0; overflow: hidden; }
.batch-dialog-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #E7E5E4;
  background: #FAFAF9;
}
.batch-dialog-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #292524;
  margin-bottom: 6px;
}
.batch-dialog-title svg { flex-shrink: 0; }
.batch-dialog-sub {
  font-size: 11.5px;
  color: #78716C;
  line-height: 1.6;
}
.batch-dialog-list {
  max-height: 48vh;
  overflow-y: auto;
  padding: 6px 16px;
}
.batch-dialog-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #F5F5F4;
}
.batch-dialog-row:last-child { border-bottom: none; }
.batch-dialog-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #E7E5E4;
  flex-shrink: 0;
}
.batch-dialog-info { flex: 1; min-width: 0; }
.batch-dialog-name {
  font-size: 12.5px;
  font-weight: 500;
  color: #292524;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-dialog-size {
  font-size: 10.5px;
  color: #78716C;
  margin-top: 3px;
}
.batch-dialog-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.batch-dialog-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid #D6D3D1;
  background: white;
  border-radius: 50%;
  font-size: 13px;
  color: #57534E;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.batch-dialog-qty button:hover { background: #F5F5F4; }
.batch-dialog-qty .qty-val {
  min-width: 26px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #292524;
}
.batch-dialog-del {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #A8A29E;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background .12s, color .12s;
}
.batch-dialog-del:hover { background: #FEF2F2; color: #EF4444; }
.batch-dialog-footer {
  padding: 12px 22px;
  font-size: 12px;
  color: #57534E;
  background: #FAFAF9;
  border-top: 1px solid #E7E5E4;
  text-align: right;
}
.batch-dialog-footer strong { color: #2A2219; font-size: 13px; }
.batch-dialog .confirm-dialog-actions {
  padding: 12px 18px 16px;
  background: #FAFAF9;
  border-top: 1px solid #E7E5E4;
}
.batch-dialog .btn-confirm:disabled {
  background: #D6D3D1;
  border-color: #D6D3D1;
  color: #A8A29E;
  cursor: not-allowed;
}
.batch-dialog .btn-confirm:disabled:hover {
  background: #D6D3D1;
  border-color: #D6D3D1;
}

/* 選択中商品チップ */
.product-chip { border: 1.5px solid #E7E5E4; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.product-chip-body { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.product-chip-img { width: 44px; height: 44px; object-fit: cover; border-radius: 2px; border: 1px solid #E7E5E4; flex-shrink: 0; }
.product-chip-name { font-size: 12px; color: #292524; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-chip-pin { font-size: 10px; color: #A8A29E; display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.product-chip-rm { width: 28px; height: 28px; border: none; background: transparent; color: #A8A29E; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; }
.product-chip-rm:hover { background: #FEF2F2; color: #EF4444; }
.pin-btn { width: 100%; padding: 10px 12px; border: none; border-top: 1px solid #F5F5F4; background: #F0F9FF; color: #0369A1; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .1s; }
.pin-btn:hover { background: #E0F2FE; }
.pin-btn.pinning { background: #83B2D0; color: #fff; }

/* 検索 */
.search-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 160px; padding: 8px 12px; border: 1px solid #E7E5E4; border-radius: 2px; background: #FAFAF9; font-size: 13px; font-family: inherit; color: #57534E; outline: none; }
.search-input:focus { border-color: #83B2D0; background: #fff; }
.search-select { padding: 8px 12px; border: 1px solid #E7E5E4; border-radius: 2px; background: #FAFAF9; font-size: 13px; font-family: inherit; color: #57534E; outline: none; }
.search-select:focus { border-color: #83B2D0; }

.cand-list-wrap { overflow-y: auto; border: 1px solid #E7E5E4; border-radius: 2px; background: #FAFAF9; padding: 10px; max-height: 60vh; }
@media (min-width: 640px) { .cand-list-wrap { max-height: 720px; } }

/* ピンモード案内 */
.pin-guide { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #FFF8EC; border: 1.5px solid #FCD34D; border-radius: 4px; font-size: 12px; color: #92400E; font-weight: 500; margin-top: 10px; }
.pin-cancel { margin-left: auto; padding: 4px 10px; border: 1px solid #FCD34D; border-radius: 2px; background: #fff; color: #92400E; font-size: 11px; cursor: pointer; font-family: inherit; }

/* ハンバーガー・ドロワー */
.hm-btn { width: 40px; height: 40px; border-radius: 50%; background: white; border: 1.5px solid #E7E5E4; box-shadow: 0 2px 8px rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; position: fixed; top: 24px; left: 20px; z-index: 40; }
.hm-btn:hover { box-shadow: 0 3px 12px rgba(0,0,0,.18); }
.hm-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #83B2D0; border: 2px solid white; font-size: 10px; color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; padding: 0 3px; pointer-events: none; }
.hm-overlay { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
.hm-overlay.open { opacity: 1; pointer-events: auto; }
.hm-drawer { position: fixed; top: 0; left: 0; bottom: 0; z-index: 35; width: min(320px, 85vw); background: white; transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s; display: flex; flex-direction: column; overflow: hidden; }
.hm-drawer.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.12); }
.hm-drawer-header { padding: 20px 20px 16px; border-bottom: 1px solid #E7E5E4; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.hm-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.hm-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: none; background: transparent; cursor: pointer; color: #A8A29E; }
.hm-close:hover { background: #F5F5F4; color: #57534E; }
.hm-clear { font-size: 10px; color: #A8A29E; background: none; border: none; cursor: pointer; font-family: inherit; }
.hm-clear:hover { color: #57534E; }
.hist-grid { display: flex; flex-direction: column; gap: 0; }
.hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  cursor: pointer;
  border-bottom: 1px solid #F5F5F4;
  transition: background .15s;
}
.hist-row:hover { background: #F8F8F7; }
.hist-row:last-child { border-bottom: none; }
.hist-row-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #E7E5E4;
  flex-shrink: 0;
  background: #FAFAF9;
}
.hist-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hist-row-date {
  font-size: 12px;
  color: #292524;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-row-latest {
  font-size: 9px;
  background: #83B2D0;
  color: #fff;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: .02em;
}
.hist-row-lowq {
  font-size: 9px;
  background: #E7E5E4;
  color: #78716C;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-left: 4px;
}
.hist-row-count {
  font-size: 11px;
  color: #A8A29E;
}
.hist-row-arrow {
  flex-shrink: 0;
  color: #C0B4A0;
  display: flex;
  align-items: center;
}
.hist-empty { font-size: 12px; color: #A8A29E; text-align: center; margin-top: 32px; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ピンマーカー */
@keyframes pin-drop { 0% { transform: translate(-50%,-120%) scale(1.3); opacity:0; } 65% { transform: translate(-50%,-95%) scale(.92); opacity:1; } 100% { transform: translate(-50%,-100%) scale(1); opacity:1; } }
.pin-marker { animation: pin-drop .22s cubic-bezier(.36,.07,.19,.97) both; }
/* ── ページ下部パディング（基本余白） ── */
.page { padding-bottom: 32px; }

/* ── セクション内側（白背景） ── */
.section-body { padding: 10px 12px; background: #fff; }

/* ── calibSection・placementSection 見出し（他セクションと同じ白背景に合わせる） ── */
#calibSection .card-title,
#placementSection .card-title {
  /* 他のカード見出しと同じ（background は .card の白を継承） */
}

/* セクション内側（白背景） */
.section-inner {
  padding: 10px 12px;
  background: #fff;
}

/* ── レビューセクション ── */
.review-separator { margin-top: 32px; padding-top: 32px; border-top: 2px solid #E7E5E4; }

/* ── インライン保存ボタン（真俯瞰図の下に表示） ── */
.map-save-row {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 12px;
}
.btn-save-snapshot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  background: #83B2D0;
  color: #fff;
  border: 1px solid #83B2D0;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
  letter-spacing: .02em;
  box-sizing: border-box;
}
.btn-save-snapshot:hover { background: #6fa3c4; border-color: #6fa3c4; }
.btn-save-snapshot:disabled { opacity: 0.7; cursor: default; }

@media (max-width: 640px) {
  .map-save-row {
    justify-content: stretch;
    margin: 10px 0 10px;
  }
  .btn-save-snapshot { flex: 1; padding: 9px 12px; }
}

/* ── フルスクリーンブロック ── */
.full-block-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(253,252,248,0.7); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.full-block-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.block-title { font-size: 14px; font-weight: 600; color: #292524; margin-bottom: 4px; }

/* ── スピナー ── */
.spinner { border-style: solid; border-color: #E7E5E4; border-top-color: #83B2D0; border-radius: 50%; animation: sp .8s linear infinite; }
.spinner--xl { width: 52px; height: 52px; border-width: 4px; }
.spinner--lg { width: 48px; height: 48px; border-width: 4px; flex-shrink: 0; }
.spinner--md { width: 36px; height: 36px; border-width: 3px; }
.spinner--center { display: block; margin: 0 auto 10px; }
.spinner-inline { width: 16px; height: 16px; border: 2px solid #fff; border-top-color: rgba(255,255,255,.4); border-radius: 50%; animation: sp .8s linear infinite; }
.loading-text { font-size: 12px; color: #57534E; letter-spacing: .04em; font-weight: 500; text-align: center; line-height: 1.6; }

/* ── 間取り図エリア ── */
.map-pin-wrap { margin-bottom: 8px; display: none; }
.map-pin-container { position: relative; display: inline-block; width: 100%; line-height: 0; }
.map-canvas { width: 100%; display: block; border-radius: 2px; border: 1px solid #E7E5E4; cursor: default; touch-action: none; }
.product-overlay-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 2px; }
.map-loading-overlay { display: none; position: absolute; inset: 0; background: rgba(253,252,248,.72); border-radius: 2px; align-items: center; justify-content: center; flex-direction: column; gap: 14px; z-index: 10; }
.map-gen-overlay { display: none; position: absolute; inset: 0; background: rgba(253,252,248,.82); border-radius: 2px; align-items: center; justify-content: center; flex-direction: column; gap: 14px; z-index: 10; padding: 16px; }
.map-footer { padding: 8px 2px 4px; }
.map-footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.map-dl-btn { display: none; font-size: 11px; padding: 5px 12px; border: none; cursor: pointer; }

/* ── アップロードプレビュー ── */
.prev-wrap { display: none; position: relative; width: 100%; line-height: 0; }
.prev-loading-overlay { display: none; position: absolute; inset: 0; background: rgba(253,252,248,.78); align-items: center; justify-content: center; flex-direction: column; gap: 14px; z-index: 10; padding: 16px; }
.prev-img { width: 100%; display: block; }

/* ── パースビュー ── */
.persp-result {
  display: none;
  margin-top: 20px;
  margin-bottom: 12px;
  padding-top: 20px;
  border-top: 1px solid #E7E5E4;
}
.persp-loading { display: none; padding: 24px; text-align: center; }
.persp-img-wrap { display: none; }
.persp-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.persp-header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-persp-regen {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #83B2D0;
  border-radius: 2px;
  color: #2E6A8A;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.btn-persp-regen:hover { background: #EAF4FB; }
.persp-footer-text { font-size: 11px; color: #A8A29E; margin-top: 6px; text-align: right; }

/* 横画像ブラッシュアップUI */
.persp-brushup {
  margin-top: 12px;
  padding: 14px 14px 12px;
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 4px;
}
.persp-brushup-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: #292524;
}
.persp-brushup-help {
  margin: 0 0 10px 0;
  font-size: 11px;
  color: #A8A29E;
  line-height: 1.5;
}
.persp-brushup-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.persp-brushup-input {
  flex: 1 1 240px;
  min-width: 180px;
  height: 42px !important;
  max-height: 42px !important;
  padding: 10px 12px;
  border: 1px solid #D6D3D1;
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
  color: #292524;
  background: #fff;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
  line-height: normal;
}
.persp-brushup-input:focus { border-color: #83B2D0; }
.persp-brushup-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 16px;
  font-size: 13px;
}
.persp-brushup-btn:disabled {
  background: #D6D3D1;
  border-color: #D6D3D1;
  color: #A8A29E;
  cursor: not-allowed;
  box-shadow: none;
}
.persp-brushup-btn:disabled:hover {
  background: #D6D3D1;
  border-color: #D6D3D1;
  box-shadow: none;
}

@media (max-width: 640px) {
  .persp-brushup-row { flex-direction: column; }
  .persp-brushup-input, .persp-brushup-btn { width: 100%; }
}
.persp-img { width: 100%; display: block; border-radius: 2px; border: 1px solid #E7E5E4; }
.persp-canvas-wrap { position: relative; width: 100%; }
.persp-pin-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  border-radius: 2px;
}
.persp-canvas-wrap.erasing .persp-pin-canvas { pointer-events: auto; cursor: crosshair; }
.persp-canvas-wrap.erasing .persp-img { cursor: crosshair; }
.persp-btn { display: none; padding: 7px 14px; background: transparent; border: 1px solid #A8A29E; border-radius: 2px; color: #57534E; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; align-items: center; gap: 6px; }
.retry-btn { display: none; padding: 7px 16px; background: transparent; border: 1px solid #83B2D0; border-radius: 2px; color: #2E6A8A; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; align-items: center; gap: 6px; }

/* ── キャリブレーション ── */
.calib-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.calib-result { display: none; margin-top: 8px; align-items: center; gap: 6px; font-size: 12px; color: #16A34A; }
.calib-input-row {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: #FAFAF9;
  border: 1px solid #F0EFEC;
  border-radius: 2px;
  flex-direction: column;
  gap: 10px;
}
.calib-input-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.calib-input-inner { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.calib-input {
  width: 110px;
  padding: 6px 10px;
  border: 1px solid #E7E5E4;
  border-radius: 2px;
  font-size: 16px; /* iOSでフォーカス時に自動ズームしないよう16px以上 */
  font-family: inherit;
  color: #57534E;
  outline: none;
  text-align: left;
  flex-shrink: 0;
  background: #fff;
  box-sizing: border-box;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
  margin: 0;
}
/* type="number" のスピナー（上下矢印）を消す */
.calib-input::-webkit-outer-spin-button,
.calib-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calib-input:focus {
  border-color: #83B2D0;
  box-shadow: none;
  outline: none;
}
.calib-input-row .calib-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #57534E;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.calib-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.calib-input-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #E7E5E4;
  margin-top: 8px;
  flex-wrap: wrap;
}
.calib-input-actions .btn-primary-sm,
.calib-input-actions .btn-cancel-sm { flex-shrink: 0; white-space: nowrap; }

/* 目立つ確定ボタン */
.btn-calib-apply {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #83B2D0;
  color: #fff !important;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(131,178,208,0.35);
  flex: 1;
  min-height: 48px;
  letter-spacing: .03em;
}
.btn-calib-apply:hover {
  background: #6fa3c4;
  box-shadow: 0 3px 12px rgba(131,178,208,0.5);
}
.btn-calib-apply:active {
  transform: scale(0.98);
}
.btn-calib-apply svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .btn-calib-apply { padding: 12px 18px; font-size: 14px; min-height: 46px; }
  .calib-input-actions { gap: 8px; }
}

/* ── キャリブレーション・ステップインジケーター ── */
.calib-steps {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 10px 12px;
  background: #FAFAF9;
  border: 1px solid #F0EFEC;
  border-radius: 2px;
  margin-bottom: 12px;
}
.calib-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #E7E5E4;
  border-radius: 2px;
  min-width: 0;
  transition: border-color .15s, background .15s;
}
.calib-step.active { border-color: #83B2D0; background: #EAF4FB; }
.calib-step.done { border-color: #16A34A; background: #F0FDF4; }
.calib-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E7E5E4;
  color: #78716C;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.calib-step.active .calib-step-num { background: #83B2D0; color: #fff; }
.calib-step.done .calib-step-num { background: #16A34A; color: #fff; }
.calib-step-label {
  font-size: 11px;
  color: #57534E;
  font-weight: 500;
  white-space: nowrap;
}
.calib-step-value {
  font-size: 10px;
  color: #16A34A;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.calib-step-arrow {
  align-self: center;
  color: #C0B4A0;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── キャリブ・ポイント編集チップ ── */
.calib-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 4px;
  margin: 12px 0;
}
.calib-chips-hint {
  font-size: 12px;
  color: #57534E;
  margin: 0;
  line-height: 1.4;
  font-weight: 500;
}

/* 基準サイズ設定の見出し＋図解 */
.calib-intro {
  margin-bottom: 14px;
  padding: 14px;
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 3px;
}
.calib-intro-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.calib-intro-figure-caption {
  margin-top: 4px;
  font-size: 10px;
  color: #A8A29E;
  text-align: center;
  line-height: 1.4;
}

/* 測り方モーダル */
.calib-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 25, 20, 0.5);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  animation: calibHelpFadeIn 0.2s ease;
}
@keyframes calibHelpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.calib-help-box {
  background: #fff;
  border-radius: 6px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: calibHelpSlideUp 0.25s ease;
}
@keyframes calibHelpSlideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.calib-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #EDE9DF;
}
.calib-help-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #292524;
}
.calib-help-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #78716C;
  cursor: pointer;
  transition: background .15s;
}
.calib-help-close:hover { background: #F5F5F4; color: #292524; }
.calib-help-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calib-help-text {
  font-size: 13px;
  line-height: 1.8;
  color: #44403C;
}
.calib-help-text strong {
  color: #292524;
  font-weight: 600;
}
.calib-help-figure {
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 4px;
  padding: 12px;
  text-align: center;
}
.calib-help-figure svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.calib-help-figure-caption {
  margin-top: 8px;
  font-size: 11px;
  color: #A8A29E;
  line-height: 1.5;
}
.calib-help-footer {
  padding: 12px 18px 18px;
  display: flex;
  justify-content: center;
}
.calib-help-ok-btn {
  padding: 10px 28px;
  background: #83B2D0;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.calib-help-ok-btn:hover { background: #6FA3C4; }
@media (max-width: 520px) {
  .calib-help-box { max-height: 95vh; }
  .calib-help-head { padding: 14px 16px; }
  .calib-help-body { padding: 16px; gap: 14px; }
  .calib-help-text { font-size: 12.5px; }
}
.calib-intro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #292524;
}
.calib-intro-title svg { flex-shrink: 0; }
.calib-intro-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid #F0C878;
  background: #FEF6E3;
  color: #8F6828;
  font-size: 11px;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(216, 168, 92, 0.15);
}
.calib-intro-help:hover {
  border-color: #D8A85C;
  background: #FDEBBF;
  color: #734E1C;
}
.calib-intro-help.active {
  border-color: #D8A85C;
  background: #D8A85C;
  color: #fff;
  box-shadow: 0 1px 3px rgba(216, 168, 92, 0.35);
}
.calib-intro-help svg { flex-shrink: 0; }
.calib-intro-help-text { font-weight: 600; }
.calib-intro-text {
  font-size: 12px;
  line-height: 1.7;
  color: #57534E;
}
.calib-intro-text strong {
  color: #292524;
  font-weight: 600;
}
.calib-hint-green {
  color: #16A34A;
  font-weight: 600;
}
.calib-hint-red {
  color: #E05252;
  font-weight: 600;
}
.calib-intro-figure {
  max-width: 220px;
}
.calib-intro-figure svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  background: white;
  border: 1px solid #E7E5E4;
}
.calib-intro-figure-caption {
  margin-top: 4px;
  font-size: 10px;
  color: #A8A29E;
  text-align: center;
  line-height: 1.4;
}
/* ヒント文 + トグルボタンを横並びに */
.calib-chips-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.calib-chips-head .calib-chips-hint { flex: 1; min-width: 0; }
.calib-lines-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #57534E;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
  flex-shrink: 0;
}
.calib-lines-toggle:hover {
  border-color: #83B2D0;
  color: #2E6A8A;
}
.calib-lines-toggle.is-hidden {
  background: #FAFAF9;
  color: #A8A29E;
  border-color: #E7E5E4;
}
.calib-chips-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.calib-chip {
  /* iOS Safari対策：全てのデフォルトスタイルを強制リセット */
  -webkit-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: #fff !important;
  background-color: #fff !important;
  /* iOSで border-style が消えないよう solid を強制 */
  border-width: 2px;
  border-style: solid;
  border-color: #D6D3D1;
  border-radius: 6px !important;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: #292524;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  white-space: nowrap;
  min-height: 44px; /* タッチターゲット最低44px */
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  /* iOS Safari でテキストが中央に来ない事がある */
  text-align: center;
  line-height: 1;
  /* outline等も明示的に消す */
  outline: none;
  /* margin もリセット */
  margin: 0;
  /* box-sizing を必ず border-box に */
  box-sizing: border-box;
}
.calib-chip:active { transform: scale(0.97); }
.calib-chip:hover { border-color: #A8A29E; }
.calib-chip.done {
  border-color: #16A34A !important;
  background: #F0FDF4 !important;
  background-color: #F0FDF4 !important;
  color: #166534 !important;
}
.calib-chip[data-target^="vp"].done {
  border-color: #E05252 !important;
  background: #FEF2F2 !important;
  background-color: #FEF2F2 !important;
  color: #991B1B !important;
}
.calib-chip.editing {
  border-color: #83B2D0 !important;
  background: #EFF6FB !important;
  background-color: #EFF6FB !important;
  box-shadow: 0 0 0 3px rgba(131,178,208,0.3);
  color: #2E6A8A !important;
}
.calib-chip-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.calib-chip-label {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.calib-chip-status {
  font-size: 12px;
  font-weight: 700;
  min-width: 10px;
  text-align: center;
}
.calib-chip.done .calib-chip-status { color: #16A34A; }
.calib-chip[data-target^="vp"].done .calib-chip-status { color: #E05252; }
.calib-chip.editing .calib-chip-status { color: #83B2D0; }

/* 編集中の大きな指示バナー */
.calib-action-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #EFF6FB !important;
  background-color: #EFF6FB !important;
  border-width: 2px;
  border-style: solid;
  border-color: #83B2D0;
  border-radius: 6px;
  margin: 12px 0;
  color: #2E6A8A;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(131,178,208,0.15);
  animation: bannerPulse 1.8s ease-in-out infinite;
  box-sizing: border-box;
}
.calib-action-banner-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #83B2D0 !important;
  background-color: #83B2D0 !important;
  color: #fff;
  border-radius: 50%;
  box-sizing: border-box;
}
@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(131,178,208,0.15); }
  50% { box-shadow: 0 2px 16px rgba(131,178,208,0.4); }
}

@media (max-width: 640px) {
  .calib-chips-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .calib-chip { padding: 10px 6px; font-size: 12px; min-height: 42px; }
  .calib-chip-label { font-size: 12px; }
  .calib-action-banner { padding: 12px 14px; font-size: 13px; }
  .calib-action-banner-icon { width: 28px; height: 28px; }
}

@media (max-width: 640px) {
  .calib-steps { flex-direction: column; gap: 4px; }
  .calib-step-arrow { transform: rotate(90deg); }
}

/* iOS Safari でフォーカス時に自動ズームしないよう、スマホでは input を 16px 以上に */
@media (max-width: 640px) {
  .search-input,
  .search-select,
  .review-textarea {
    font-size: 16px;
  }
}
.calib-label { font-size: 12px; color: #57534E; }
.btn-calib { padding: 6px 14px; border: 1px solid #83B2D0; border-radius: 2px; background: #fff; color: #2E6A8A; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.btn-primary-sm { padding: 6px 14px; border: none; border-radius: 2px; background: #83B2D0; color: #fff; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn-cancel-sm { padding: 6px 10px; border: 1px solid #E7E5E4; border-radius: 2px; background: #fff; color: #78716C; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-reset-calib { margin-left: 6px; padding: 3px 8px; border: 1px solid #D1FAE5; border-radius: 2px; background: #fff; color: #16A34A; font-size: 11px; cursor: pointer; font-family: inherit; }

/* ── 配置セクション ── */
.revert-bar { display: none; padding: 4px 0; }
.revert-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.btn-revert { padding: 6px 14px; background: transparent; border: 1px solid #D6D3D1; border-radius: 2px; color: #78716C; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.hidden-el { display: none; }

/* ── 商品一覧 ── */
.cand-count { font-size: 11px; color: #A8A29E; margin-bottom: 8px; }
.cand-list-wrap-outer { position: relative; }
.cand-block-overlay { display: none; position: absolute; inset: 0; background: rgba(253,252,248,0.82); z-index: 20; align-items: center; justify-content: center; flex-direction: column; gap: 10px; border-radius: 2px; }
.cand-loading { font-size: 12px; color: #A8A29E; text-align: center; padding: 20px; }
.cand-img-col { position: relative; flex-shrink: 0; }
.cand-info-col { flex: 1; min-width: 0; }
.cand-size-text { font-size: 11px; color: #83B2D0; margin-top: 2px; font-weight: 500; }
.cand-warn-text { font-size: 10px; color: #F59E0B; margin-top: 2px; }
.cand-link-row { padding: 8px 12px; border-top: 1px solid #F5F5F4; font-size: 11px; color: #83B2D0; display: flex; align-items: center; gap: 5px; }
.cand-nosize-warn { font-size: 9px; color: #F59E0B; padding: 2px 6px 4px; }
.btn-disabled-overlay { opacity: 0.4; cursor: not-allowed; }
.product-list-divider { border-top: 1px solid #F5F5F4; margin-top: 8px; padding-top: 8px; }

/* ── 詳細カテゴリタグクラウド ── */
.subcat-cloud {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #FAFAF9;
  border: 1px solid #F0EFEC;
  border-radius: 2px;
}
.subcat-label {
  font-size: 11px;
  color: #78716C;
  font-weight: 500;
  margin-right: 2px;
}
.subcat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #E7E5E4;
  border-radius: 999px;
  font-size: 11px;
  font-family: inherit;
  color: #57534E;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap;
  line-height: 1.3;
}
.subcat-tag:hover {
  border-color: #83B2D0;
  color: #2E6A8A;
}
.subcat-tag.active {
  background: #83B2D0;
  border-color: #83B2D0;
  color: #fff;
}
.subcat-tag-count {
  font-size: 9px;
  color: #A8A29E;
  background: #F5F5F4;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 500;
}
.subcat-tag.active .subcat-tag-count {
  color: #fff;
  background: rgba(255,255,255,0.25);
}

/* ── 履歴 ── */
.hist-badge { display: none; background: #E05252; color: #fff; font-size: 10px; font-weight: 600; border-radius: 10px; padding: 1px 6px; line-height: 1.4; align-items: center; }
.hist-load-area { margin-top: 0; }
.hist-header-row { display: flex; align-items: center; gap: 12px; }
.hist-title { font-size: 13px; font-weight: bold; color: #292524; display: flex; align-items: center; gap: 6px; }

/* ── レビューフォーム ── */
.review-textarea { width: 100%; padding: 12px 16px; border-radius: 2px; border: 1px solid #E7E5E4; background: #FAFAF9; font-size: 13px; font-family: inherit; color: #57534E; min-height: 140px; outline: none; resize: vertical; transition: border-color .15s, background .15s; box-sizing: border-box; display: block; margin-bottom: 14px; }
.review-textarea:focus { border-color: #83B2D0; background: #fff; }
.btn-review { width: 100%; padding: 14px; background: #D6D3D1; color: #A8A29E; border: none; border-radius: 2px; font-size: 14px; font-weight: 500; letter-spacing: .1em; cursor: not-allowed; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; transition: background .15s; }

/* ── ハンバーガーメニュー ── */
.hm-btn-wrap { position: fixed; top: 24px; left: 20px; z-index: 40; }
.hm-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 36px; height: 36px; background: #fff; border: 1px solid #E7E5E4; border-radius: 2px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.hm-bar { display: block; width: 16px; height: 2px; background: #57534E; border-radius: 2px; }

/* ── ユーティリティ ── */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.info-text { font-size: 12px; color: #A8A29E; }
.info-text-right { font-size: 11px; color: #A8A29E; line-height: 1.7; margin-bottom: 6px; text-align: right; }
.guide-text { font-size: 12px; color: #78716C; }
.sub-text { font-size: 10px; color: #A8A29E; }
.emoji-icon { font-size: 18px; flex-shrink: 0; }
.btn-group-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-save-sm { padding: 5px 12px; background: #83B2D0; color: #fff; border: none; border-radius: 2px; font-size: 11px; font-weight: 500; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px; }
.text-success { font-size: 12px; color: #50B86C; padding: 8px 0; }
.text-error { font-size: 12px; color: #E05252; padding: 8px 0; }
.status-area {}
.card-title-actions { display: flex; align-items: center; gap: 8px; }
.info-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: #83B2D0; text-decoration: none; letter-spacing: 0.04em; }
.info-link:hover { text-decoration: underline; }

/* step3Cardは常時表示 */
#step3Card { display: block; }

/* 作り直しボタンはcard-title内に移動 */
#retryMapBtn { display: none; }

/* 真俯瞰図エリアの上余白 */
.map-pin-wrap { margin-top: 12px; }

/* ③ 家具・インテリアをレイアウトするセクション */
.calib-guide-text {
  font-size: 14px;
  color: #57534E;
  line-height: 1.8;
  margin-bottom: 16px;
}
/* チップボックス内に配置された計測ガイド（控えめ版） */
.calib-guide-inline {
  font-size: 12px;
  line-height: 1.5;
  color: #78716C;
  margin: 4px 0 0;
  padding: 8px 10px;
  background: #F5F5F4;
  border-radius: 4px;
}
.calib-guide-inline small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.btn-calib-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #83B2D0;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background .15s;
  white-space: nowrap;
}
.btn-calib-lg:hover { background: #6fa3c4; }
.btn-calib-lg:disabled { background: #D6D3D1; color: #A8A29E; cursor: not-allowed; opacity: 0.7; }

/* ── ステップ間の↓区切り ── */
.step-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}
.step-divider svg {
  opacity: 0.5;
}

/* calibSectionは常時表示（プレースホルダで中身を制御） */
#calibSection { display: block; }
#calibSection.hidden-el { display: none; }
#calibSection.visible { display: block; }

/* STEP3 空状態プレースホルダ（②未完了時に表示） */
.step3-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: #A8A29E;
  text-align: center;
  gap: 10px;
}
.step3-placeholder svg {
  opacity: 0.6;
}
.step3-placeholder p {
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  color: #A8A29E;
}

/* STEP4 メインアクション（横画像生成ボタンを中央に大きく配置） */
#step4MainAction {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 24px;
  gap: 22px;
}
.step4-intro {
  font-size: 13px;
  line-height: 1.7;
  color: #57534E;
  text-align: center;
  margin: 0;
  width: 100%;
}
.persp-btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background: #83B2D0;
  border: 1px solid #83B2D0;
  border-radius: 3px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 10px rgba(131,178,208,0.35);
  transition: background .15s, box-shadow .15s, transform .1s;
  letter-spacing: .03em;
  min-width: 220px;
}
.persp-btn-lg:hover {
  background: #6fa3c4;
  border-color: #6fa3c4;
  box-shadow: 0 4px 14px rgba(131,178,208,0.5);
}
.persp-btn-lg:active { transform: scale(0.98); }
.persp-btn-lg svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .persp-btn-lg { padding: 12px 20px; font-size: 13px; min-width: 180px; }
  .step4-intro { font-size: 12px; }
  #step4MainAction { padding: 16px 12px 12px; gap: 12px; }
}

/* STEP5 提案書作成 */
#step5MainAction {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 24px;
  gap: 22px;
}
.step5-intro {
  font-size: 13px;
  line-height: 1.7;
  color: #57534E;
  text-align: center;
  margin: 0;
  width: 100%;
}
.step5-warning {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #C0392B;
  background: #FDEAEA;
  border: 1px solid #F5C0C0;
  border-radius: 3px;
  line-height: 1.6;
  text-align: left;
}
.step5-warning svg { flex-shrink: 0; color: #C0392B; margin-top: 2px; }
.step5-warning-sub {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 400;
  color: #8B3A3A;
}
.proposal-success {
  padding: 20px 18px 18px;
  background: #F6FAEC;
  border: 1px solid #B8D8A0;
  border-radius: 4px;
  margin: 14px 0 0;
}
.proposal-success-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #2F6B3A;
  margin-bottom: 14px;
}
.proposal-success-head svg { flex-shrink: 0; }
.proposal-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.proposal-url-input {
  flex: 1 1 240px;
  min-width: 180px;
  height: 38px !important;
  max-height: 38px !important;
  padding: 9px 12px;
  border: 1px solid #D6D3D1;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: #292524;
  background: #fff;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  line-height: normal;
}
.proposal-url-input:focus { border-color: #83B2D0; }
.proposal-copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #83B2D0;
  color: #4A849E;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.proposal-copy-btn:hover { background: #F0F9FF; }
.proposal-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.proposal-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #83B2D0;
  border: 1px solid #83B2D0;
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  font-family: inherit;
  transition: background .15s;
}
.proposal-open-btn:hover { background: #6fa3c4; border-color: #6fa3c4; }
.proposal-note {
  font-size: 11px;
  color: #78716C;
  margin: 8px 0 0;
  line-height: 1.6;
}

@media (max-width: 640px) {
  #step5MainAction { padding: 16px 12px 12px; gap: 12px; }
  .step5-intro { font-size: 12px; }
  .step5-warning { font-size: 11.5px; padding: 8px 12px; }
  .proposal-url-row, .proposal-actions-row { flex-direction: column; }
  .proposal-url-input, .proposal-copy-btn, .proposal-open-btn { width: 100%; justify-content: center; }
}

/* STEP2 空状態プレースホルダ（写真未アップロード時に表示） */
.step2-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 28px;
  gap: 14px;
  color: #A8A29E;
  text-align: center;
}
.step2-placeholder-illust {
  opacity: 0.85;
  max-width: 100%;
  height: auto;
}
.step2-placeholder p {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: #A8A29E;
}

/* 初期状態では「真俯瞰図を生成する」ボタンは非表示（写真アップロード時に表示） */
#genMapBtn { display: none; }

/* calibResult のフォントサイズを btn-calib-lg に合わせる */
.calib-result {
  font-size: 15px;
  font-weight: 500;
}
.calib-result #calibResultText {
  font-size: 15px;
}

/* 線を引いて測るボタンを中央寄せ */
.calib-row {
  justify-content: center;
}

/* placementSectionはcalibSection内のサブセクション */
#placementSection { display: none; }
#placementSection.visible { display: block; }

/* ── 消しゴム（家具消去）UI ── */
/* パネル全体：赤い枠線で「家具を消すモード中」であることを明示 */
.eraser-panel {
  border: 2px solid #E05252;
  border-radius: 6px;
  background: #FEF2F2;
  padding: 10px 14px;
  margin: 8px 0 12px;
  box-shadow: 0 1px 4px rgba(224,82,82,0.12);
}
.eraser-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.eraser-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #E05252;
}
.eraser-cancel-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #57534E;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.eraser-cancel-btn:hover { border-color: #78716C; color: #292524; }
.eraser-panel-guide {
  font-size: 12px;
  color: #78350F;
  margin: 0 0 10px;
  line-height: 1.4;
}
.eraser-panel-guide strong {
  color: #E05252;
  font-weight: 600;
}
.eraser-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.eraser-panel-clear {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #57534E;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.eraser-panel-clear:hover { border-color: #A8A29E; color: #292524; }
/* 実行ボタン：一番目立つ赤塗りつぶしボタン */
.eraser-panel-apply {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  background: #E05252;
  border: 1px solid #E05252;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(224,82,82,0.3);
  letter-spacing: .02em;
  flex: 1;
  min-height: 46px;
  min-width: 180px;
}
.eraser-panel-apply:hover {
  background: #c94040;
  border-color: #c94040;
  box-shadow: 0 3px 12px rgba(224,82,82,0.5);
}
.eraser-panel-apply:active { transform: scale(0.98); }
.eraser-panel-apply svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .eraser-panel { padding: 8px 10px; margin: 6px 0 10px; }
  .eraser-panel-title { font-size: 12px; }
  .eraser-panel-guide { font-size: 11px; }
  .eraser-panel-apply { padding: 10px 14px; font-size: 13px; min-width: 0; }
  .eraser-panel-clear { padding: 7px 10px; font-size: 11px; }
}

/* 旧スタイル（互換用） */
.eraser-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.eraser-guide-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #E05252;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
.eraser-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-eraser-apply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #E05252;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-eraser-apply:hover { background: #c94040; }

/* 俯瞰図直下のツールバー（家具を消すボタン等を配置） */
.map-tools-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 2px 2px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* 寸法表示トグルボタン */
.btn-dimension {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid #83B2D0;
  border-radius: 2px;
  color: #4A849E;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-dimension:hover {
  background: #EAF4FB;
  color: #2E6A8A;
}
.btn-dimension.active {
  background: #83B2D0;
  color: #fff;
  border-color: #83B2D0;
}
.btn-dimension.active:hover {
  background: #6fa3c4;
  border-color: #6fa3c4;
}

/* 距離測定ボタン */
.btn-measure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid #D8A85C;
  border-radius: 2px;
  color: #A07832;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-measure:hover {
  background: #FDF6E9;
  color: #8F6828;
}
.btn-measure.active {
  background: #D8A85C;
  color: #fff;
  border-color: #D8A85C;
}
.btn-measure.active:hover {
  background: #C79746;
  border-color: #C79746;
}

/* 空の部屋⇄家具込み 切替ボタン */
.btn-room-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid #8FA98F;
  border-radius: 2px;
  color: #4F6E4F;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-room-mode:hover {
  background: #EEF4EE;
  color: #355535;
}
.btn-room-mode.active {
  background: #6F8F6F;
  color: #fff;
  border-color: #6F8F6F;
}
.btn-room-mode.active:hover {
  background: #5F7F5F;
  border-color: #5F7F5F;
}

/* 距離測定オーバーレイ（俯瞰図上） */
.measure-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.measure-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.measure-svg .measure-delete-btn {
  pointer-events: auto;
}

/* 距離測定ガイドパネル（俯瞰図の下） */
.measure-panel {
  margin-top: 8px;
  padding: 12px 14px;
  background: #FDF6E9;
  border: 1px solid #E8C68F;
  border-radius: 3px;
}
.measure-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.measure-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #8F6828;
}
.measure-panel-title svg { color: #D8A85C; flex-shrink: 0; }
.measure-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #78716C;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.measure-cancel-btn:hover { background: #F5F5F4; color: #2A2219; }
.measure-panel-guide {
  font-size: 12px;
  color: #78716C;
  line-height: 1.6;
  margin: 0 0 10px;
}
.measure-panel-guide strong { color: #A07832; font-weight: 600; }
.measure-panel-actions { display: flex; gap: 8px; }
.measure-panel-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #78716C;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.measure-panel-clear:hover { background: #F5F5F4; color: #2A2219; }

/* 寸法ラベル（俯瞰図のアイテム上に重ねて表示） */
.dim-label {
  position: absolute;
  pointer-events: none;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dim-label-text {
  background: rgba(42, 34, 25, 0.88);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 幅ラベル（アイテムの上部外側、中央寄せ） */
.dim-label-width {
  left: 0;
  right: 0;
  top: -26px;
  flex-direction: column;
}
.dim-label-width .dim-label-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 1px;
  background: #83B2D0;
}
.dim-label-width .dim-tick {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: #83B2D0;
}
.dim-label-width .dim-tick-left { left: 0; }
.dim-label-width .dim-tick-right { right: 0; }
.dim-label-width .dim-label-text {
  position: relative;
  z-index: 1;
  margin-top: -1px;
}

/* 奥行きラベル（アイテムの右辺外側、中央寄せ） */
.dim-label-depth {
  top: 0;
  bottom: 0;
  right: -30px;
  flex-direction: row;
}
.dim-label-depth .dim-label-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 1px;
  background: #83B2D0;
}
.dim-label-depth .dim-tick {
  position: absolute;
  left: -4px;
  height: 1px;
  width: 9px;
  background: #83B2D0;
}
.dim-label-depth .dim-tick-top { top: 0; }
.dim-label-depth .dim-tick-bottom { bottom: 0; }
.dim-label-depth .dim-label-text {
  position: relative;
  z-index: 1;
  margin-left: -1px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* 家具を消すボタン（警告赤系） */
.btn-eraser,
.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid #E05252;
  border-radius: 2px;
  color: #E05252;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-eraser:hover,
.btn-danger-outline:hover {
  background: #E05252;
  color: #fff;
  border-color: #E05252;
}

/* 横からの画像を生成：主要アクション（濃い青のプライマリ） */
.btn-persp-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: #83B2D0;
  border: 1px solid #83B2D0;
  border-radius: 2px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 2px 6px rgba(131,178,208,0.3);
  letter-spacing: .02em;
}
.btn-persp-primary:hover {
  background: #6fa3c4;
  border-color: #6fa3c4;
  box-shadow: 0 3px 10px rgba(131,178,208,0.5);
}
.btn-persp-primary:active {
  transform: scale(0.98);
}
.btn-persp-primary svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .eraser-row { gap: 8px; padding: 8px 0; }
  .eraser-guide-compact { font-size: 11px; width: 100%; flex-basis: 100%; }
  .eraser-actions-row { width: 100%; justify-content: flex-end; }
  .btn-persp-primary { padding: 9px 14px; font-size: 12px; }
}

/* ── 配置済み商品リスト ── */
.placed-product-list:not(:empty) {
  margin-top: 12px;
  border-top: 1px solid #F5F5F4;
  padding-top: 12px;
}
.placed-list-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #57534E;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.placed-resize-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #57534E;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.placed-resize-toggle:hover {
  border-color: #83B2D0;
  color: #2E6A8A;
}
.placed-resize-toggle.active {
  background: #83B2D0;
  border-color: #83B2D0;
  color: #fff;
}
.placed-resize-toggle.active:hover {
  background: #6fa3c4;
  border-color: #6fa3c4;
  color: #fff;
}

/* 個別の商品行にある「サイズを調整」ボタンと横並びアクション行 */
.placed-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.placed-item-resize {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: #fff;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
  color: #57534E;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.placed-item-resize:hover {
  border-color: #83B2D0;
  color: #2E6A8A;
}
.placed-item-resize.active {
  background: #83B2D0;
  border-color: #83B2D0;
  color: #fff;
}
.placed-item-resize.active:hover {
  background: #6fa3c4;
  border-color: #6fa3c4;
}
.placed-item-resize-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 3px 8px;
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 3px;
}
.placed-item-resize-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #78716C;
  font-weight: 500;
}
.placed-item-resize-label svg { color: #83B2D0; }
.placed-item-resize-member {
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #83B2D0;
  border-radius: 2px;
  color: #2E6A8A;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.placed-item-resize-member:hover {
  background: #EAF4FB;
}
.placed-list-item.editing {
  background: #EFF6FB;
  border-left: 3px solid #83B2D0;
  padding-left: 7px;
}

/* 手動サイズ調整中のオーバーレイ要素の強調 */
.resize-editing {
  outline: 2px dashed #83B2D0;
  outline-offset: 2px;
}
.resize-handle {
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s, background .1s;
}
.resize-handle:hover {
  background: #EFF6FB !important;
}
.resize-handle:active {
  transform: scale(1.2);
}
.placed-list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.placed-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 2px;
}
.placed-list-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  background: #F5F5F4;
}
.placed-list-info { flex: 1; min-width: 0; }
.placed-list-name {
  font-size: 13px;
  font-weight: 500;
  color: #292524;
  margin-bottom: 2px;
  line-height: 1.4;
}
.placed-list-qty-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  background: #83B2D0;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.placed-list-size {
  font-size: 11px;
  color: #78716C;
  margin: 0 0 4px;
  line-height: 1.3;
}
.placed-list-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #2A2219;
  margin: 0 0 6px;
  line-height: 1.4;
}
.placed-list-price-current {
  font-weight: 600;
  font-size: 13px;
  color: #2A2219;
}
.placed-list-price-current.is-sale {
  color: #E05252;
}
.placed-list-price-tax {
  font-size: 10px;
  font-weight: 400;
  color: #A8A29E;
}
.placed-list-sale-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #E05252;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.placed-list-price-original {
  font-size: 11px;
  font-weight: 400;
  color: #A8A29E;
  text-decoration: line-through;
}
.placed-list-price-subtotal {
  display: inline-block;
  padding: 1px 7px;
  background: #EDE9DF;
  color: #57534E;
  font-size: 11px;
  font-weight: 500;
  border-radius: 2px;
}
.placed-list-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #83B2D0;
  text-decoration: none;
}
.placed-list-link:hover { text-decoration: underline; }

/* ── 初回アクセス・同意モーダル ── */
.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(80, 70, 60, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.consent-box {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 4px;
  padding: 28px 28px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.consent-title {
  font-size: 17px;
  font-weight: 600;
  color: #292524;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F0EFEC;
  letter-spacing: 0.02em;
}
.consent-text {
  font-size: 13px;
  line-height: 1.9;
  color: #57534E;
  margin: 0 0 14px;
}
.consent-note {
  background: #FAFAF9;
  border: 1px solid #E7E5E4;
  border-radius: 2px;
  padding: 12px 14px;
  margin: 16px 0 20px;
}
.consent-note-title {
  font-size: 12px;
  font-weight: 600;
  color: #57534E;
  margin: 0 0 6px;
}
.consent-note-text {
  font-size: 11px;
  line-height: 1.8;
  color: #78716C;
  margin: 0 0 2px;
}
.consent-note-text:last-child { margin-bottom: 0; }
.consent-btn {
  width: 100%;
  padding: 14px;
  background: #83B2D0;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.consent-btn:hover { background: #6fa3c4; }