/* 3Dリフォーム価格シミュレーション 固有（共通は ../../shared/ui.css） */
.page { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }
.page h1 { font-size: 20px; margin-bottom: 4px; }
.page .lead { color: var(--muted); margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pcard { overflow: hidden; display: flex; flex-direction: column; }
.pcard .thumb { height: 160px; background: linear-gradient(180deg, #eef2f7, #e6ebf2); }
.pcard .thumb canvas { width: 100%; height: 100%; }
.pcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .name { font-weight: 700; }
.pcard .meta { font-size: 12px; color: var(--muted); }
.pcard .actions { margin-top: auto; padding-top: 6px; }
.pcard .actions .btn { width: 100%; justify-content: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.steps .card { padding: 12px 14px; }
.steps .n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 6px; }

/* ステージ */
.stage-back { position: absolute; right: 12px; top: 12px; z-index: 6; }
.room-tabs { position: absolute; left: 12px; top: 232px; z-index: 5; display: flex; flex-direction: column; gap: 4px; max-height: calc(100% - 340px); overflow: auto; }
.room-tabs button { text-align: left; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.92); font-size: 12px; box-shadow: var(--shadow); }
.room-tabs button.on { background: var(--pink); color: #fff; border-color: var(--pink); }
.room-tabs button small { opacity: .75; margin-left: 4px; }
.ba-switch { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: inline-flex; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.ba-switch button { border: none; background: transparent; padding: 7px 18px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.ba-switch button.on { background: var(--pink); color: #fff; }
.ba-switch button[data-v="before"].on { background: #6b7280; }

/* サイド */
.est-bar { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 14px 10px; }
.est-bar .total { display: flex; align-items: baseline; gap: 8px; }
.est-bar .total .v { font-size: 24px; font-weight: 800; }
.est-bar .total .l { font-size: 12px; color: var(--muted); }
.est-bar .sub { font-size: 11px; color: var(--muted); }
.est-bar .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.est-bar .row .btn { flex: 1; justify-content: center; }
.est-bar .over { color: var(--danger); font-weight: 700; }
.est-bar .within { color: var(--ok); font-weight: 700; }
.budget-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.budget-row input { width: 110px; }
.cat-tabs { flex-wrap: wrap; position: static; }
.cat-tabs button { flex: 1 1 auto; min-width: 60px; padding: 9px 4px; font-size: 12px; }
.cat-tabs button .ic { display: block; font-size: 15px; }
.cat-tabs button.changed::after { content: '●'; color: var(--pink); font-size: 8px; margin-left: 3px; vertical-align: top; }
.room-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sw { border: 2px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.sw:hover { border-color: #c9d2e0; }
.sw.on { border-color: var(--pink); background: #fdf2f8; }
.sw.orig { border-style: dashed; }
.sw .chip-color { height: 34px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); }
.sw .n { font-size: 12px; font-weight: 600; line-height: 1.3; }
.sw .p { font-size: 11px; color: var(--muted); }
.vcard { border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); cursor: pointer; margin-bottom: 8px; }
.vcard.on { border-color: var(--pink); background: #fdf2f8; }
.vcard.orig { border-style: dashed; }
.vcard .h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 13px; }
.vcard .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vcard .p { font-size: 13px; font-weight: 700; margin-top: 4px; }
.vcard .p small { font-weight: 400; color: var(--muted); }
.side-body .note { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* 内訳・比較・プラン */
.est-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.est-table th, .est-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.est-table td.r, .est-table th.r { text-align: right; white-space: nowrap; }
.est-table tr.cat td { background: var(--panel-2); font-weight: 700; }
.est-table tr.sum td { font-weight: 700; }
.est-table tr.total td { font-size: 16px; font-weight: 800; border-top: 2px solid var(--text); }
.est-table .note { color: var(--muted); font-size: 11px; }
.grade-cmp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grade-cmp .g { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.grade-cmp .g.rec { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grade-cmp .g .t { font-weight: 800; font-size: 15px; }
.grade-cmp .g .v { font-size: 20px; font-weight: 800; }
.grade-cmp .g .d { font-size: 12px; color: var(--muted); }
.grade-cmp .g ul { margin: 4px 0; padding-left: 16px; font-size: 12px; }
.grade-cmp .g .btn { margin-top: auto; justify-content: center; }
@media (max-width: 700px) { .grade-cmp { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.plan .h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan .h .t { font-weight: 800; }
.plan .h .v { font-weight: 800; font-size: 18px; }
.plan .d { font-size: 12px; color: var(--muted); }
.plan .chosen { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.plan .chosen span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.plan .btn { width: 100%; justify-content: center; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .room-tabs { top: 8px; left: 120px; right: 90px; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; max-height: none; scrollbar-width: none; }
  .room-tabs button { padding: 4px 8px; font-size: 11px; flex: none; }
  .stage-back { right: 8px; top: 8px; }
  .stage-back .btn { padding: 4px 8px; font-size: 11px; }
  .ba-switch { bottom: 50px; }
  .level-tabs { right: 8px; bottom: 96px; }
  .prop-label { display: none; }
  .est-bar { padding: 8px 12px 8px; }
  .est-bar .total .v { font-size: 20px; }
}

/* 階タブは右下（Before/After は中央下） */
.level-tabs { bottom: 14px; }
