/* 유지보수 지원 창. 색·글꼴·단추·복합기 살펴보기(.sr-mx-*)는 쇼룸 스타일(showroom.css)을 그대로 쓰고, 여기는 배치와 문의 도우미만 정한다.
   평시에는 회색·흰색만, 파랑은 보내기 단추와 부품 보기 같은 주요 동작에만 쓴다. */
body { height: var(--vvh, 100dvh); }
.sp-top { flex: none; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.sp-logo { height: 22px; }
.sp-top h1 { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; }
.sp-showroom-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sp-showroom-link:hover { background: var(--accent-soft); }
.sp-showroom-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-lang { margin-left: auto; display: flex; gap: 4px; }
.sp-btn { height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--text); font: 500 13px/1 var(--font); white-space: nowrap; }
.sp-btn:hover { border-color: #8c96a6; }
.sp-btn.is-active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sp-tabs { flex: none; display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.sp-tab { flex: 1; min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 500 14px/1 var(--font); }
.sp-tab[aria-selected="true"] { border-bottom-color: var(--text); color: var(--text); font-weight: 700; }

.sp-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sp-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card); }
.sp-mfp { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
body[data-tab="chat"] .sp-mfp, body[data-tab="mfp"] .sp-chat { display: none; }
.sp-chat-head, .sp-mfp-head { flex: none; padding: 12px 18px 10px; }
.sp-chat-head { border-bottom: 1px solid var(--line); }
.sp-chat-head h2, .sp-mfp-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.sp-chat-head p, .sp-mfp-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sp-mfp-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#sp-tour-replay { min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--accent); font: 600 12px/1.3 var(--font); cursor: pointer; }
#sp-tour-replay:focus-visible, .sp-tour button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-tour { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; margin-top: 9px; padding: 10px 0; border-block: 1px solid var(--line); }
.sp-tour[hidden] { display: none; }
#sp-tour-count { grid-column: 1; color: var(--accent); font-size: 11px; font-weight: 700; }
#sp-tour-title { grid-column: 1; font-size: 14px; }
.sp-mfp-head #sp-tour-body { grid-column: 1; margin: 0; color: var(--text); font-size: 13px; }
.sp-tour-actions { grid-column: 2; grid-row: 1 / 4; display: flex; align-items: flex-end; gap: 6px; }
.sp-tour-actions button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--text); font: 600 12px/1.3 var(--font); cursor: pointer; }
#sp-tour-action { border-color: var(--accent); background: var(--accent); color: #fff; }
.sp-room-picker { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 7px; font-size: 12px; }
.sp-room-picker span { margin-right: 3px; color: var(--muted); font-weight: 600; }
.sp-room-picker button { min-height: 30px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--text); font: 500 12px/1.2 var(--font); }
.sp-room-picker button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: #174a9c; font-weight: 700; }
.sp-room-picker button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-series { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 12px 10px; }
.sp-series-item { display: flex; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.sp-series-item.is-current { border-color: #9cb9dd; background: #f4f8fd; }
.sp-series-item button { width: 100%; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sp-series-item button[aria-pressed="true"] strong { color: var(--accent); }
.sp-series-item strong { font-size: 13px; line-height: 1.25; }
.sp-series-item strong span { color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.sp-series-links { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.sp-series-links a { color: #475467; font-size: 11px; line-height: 1.3; text-decoration: underline; text-underline-offset: 2px; }
.sp-series-links a:hover { color: var(--accent); }
.sp-series-item button:focus-visible, .sp-series-links a:focus-visible, .sp-swatches button:focus-visible, .sp-preview-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-series-item .sp-finisher-focus { min-height: 30px; color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sp-colors { flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.sp-colors > span { flex: none; font-size: 12px; font-weight: 700; }
.sp-swatches { flex: none; display: flex; gap: 6px; }
.sp-swatches button { width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.sp-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
/* 3D: 쇼룸 살펴보기와 같은 부품 목록·카드·단추 줄을 이 칸 안에 띄운다. [나가기]는 나갈 곳이 없어 숨긴다 */
.sp-stage { background: #e9edf2; }
.sp-room-scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sp-room-wall { position: absolute; inset: 0 0 28%; background: linear-gradient(90deg, #f0f3f6, #fff 48%, #eef2f6); border-bottom: 2px solid #c8d0d9; }
.sp-room-wall::before { content: ''; position: absolute; inset: 0 0 auto; height: 9px; background: #d5e2f1; }
.sp-room-mark { position: absolute; top: 10%; right: 11%; color: #354357; font-size: clamp(14px, 2.2vw, 28px); font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.sp-room-mark strong { color: #0d59ab; }
.sp-room-floor { position: absolute; inset: 72% -25% -20%; background: linear-gradient(#e1e5e8, #cbd0d4); transform: perspective(460px) rotateX(35deg); transform-origin: top center; }
.sp-room-window, .sp-room-shelf { display: none; }
.sp-stage[data-room="office"] .sp-room-wall { background: linear-gradient(90deg, #ecebe6, #f7f5f0 54%, #e8e5de); border-bottom-color: #a8a7a2; }
.sp-stage[data-room="office"] .sp-room-wall::before { background: #d5d2c9; }
.sp-stage[data-room="office"] .sp-room-mark { display: none; }
.sp-stage[data-room="office"] .sp-room-window { display: block; position: absolute; top: 13%; left: 7%; width: 25%; height: 48%; border: 9px solid #d7d9d7; background: linear-gradient(130deg, #d5e3ea, #f5f7f5 58%, #cbdde5); box-shadow: 0 4px 12px rgba(40, 48, 52, .1); }
.sp-stage[data-room="office"] .sp-room-window::after { content: ''; position: absolute; left: 49%; top: 0; bottom: 0; width: 5px; background: #d7d9d7; }
.sp-stage[data-room="office"] .sp-room-shelf { display: block; position: absolute; top: 31%; right: 6%; width: 19%; height: 7px; background: #a69b89; box-shadow: 0 55px #a69b89, 0 6px 7px rgba(54, 48, 37, .13); }
.sp-stage[data-room="office"] .sp-room-shelf::before { content: ''; position: absolute; bottom: 7px; left: 14%; width: 14%; height: 27px; background: #b1b8b1; box-shadow: 22px 0 #d2bd9b, 51px 0 #a5b8b4; }
.sp-stage[data-room="office"] .sp-room-floor { background: linear-gradient(#ddd8cf, #c9c1b5); }
#sp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#sp-canvas:active { cursor: grabbing; }
.sp-view-controls { position: absolute; top: 12px; left: 50%; z-index: 3; display: flex; gap: 4px; transform: translateX(-50%); padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.94); }
.sp-view-controls[hidden] { display: none; }
.sp-view-controls button { min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 600 16px/1 var(--font); }
.sp-view-controls button:hover, .sp-view-controls button:focus-visible { background: var(--accent-soft); outline: none; }
.sp-stage .sr-mx-card.is-empty { display: none; }
/* 넓은 화면만 위쪽 여백을 줄인다(좁은 화면은 쇼룸처럼 아래에서 올라오는 판) */
@media (min-width: 761px) {
  .sp-stage .sr-mx-list { top: 12px; }
  .sp-stage .sr-mx-card { top: 12px; }
}
.sp-stage .sr-mx-exit { display: none; }
.sp-fail { position: absolute; inset: 0; display: flex; overflow-y: auto; padding: 16px; color: #475467; text-align: center; }
.sp-fail[hidden] { display: none; }
.sp-fail-body { width: 100%; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sp-fail p, .sp-fail h3 { max-width: 50ch; margin: 0; }
#sp-fallback-path { color: var(--text); font-weight: 600; line-height: 1.6; }
.sp-fail h3 { color: var(--text); font-size: 16px; }
.sp-fail label { color: var(--text); font-size: 13px; font-weight: 600; }
.sp-fail select { width: min(100%, 320px); min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); font: 500 14px/1.3 var(--font); }
.sp-mini { position: relative; width: 110px; height: 118px; margin: 26px auto 42px; transform: scale(1.55); }
.sp-mini-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 780px); margin: 8px auto; }
.sp-mini-slot { min-width: 0; display: grid; justify-items: center; padding: 8px 0; border: 1px solid transparent; border-radius: 9px; }
.sp-mini-slot.is-selected { border-color: #9cb9dd; background: rgba(255,255,255,.72); }
.sp-mini-slot b { font-size: 13px; }
.sp-mini-row .sp-mini { margin: 8px auto 28px; transform: scale(1.2); transform-origin: top center; }
.sp-mini i { position: absolute; display: block; border-radius: 4px; }
.sp-mini-top { top: 4px; left: 16px; width: 78px; height: 15px; background: #d9dfe6; }
.sp-mini-screen { z-index: 1; top: 23px; right: 3px; width: 31px; height: 23px; border: 4px solid #333e4d; background: #182536; transform: rotate(-13deg); }
.sp-mini-screen::after { content: ''; position: absolute; right: -9px; bottom: -11px; width: 5px; height: 5px; border-radius: 50%; background: #657181; }
.sp-mini.is-awake .sp-mini-screen { background: #5d96dd; }
.sp-mini .sp-mini-keyboard { display: none; z-index: 2; top: 49px; right: 1px; width: 32px; height: 9px; background: repeating-linear-gradient(90deg, #3d4856 0 4px, #b7c1cd 4px 5px); transform: rotate(-13deg); }
.sp-mini.is-x9 .sp-mini-keyboard { display: block; }
.sp-mini-body { top: 25px; left: 14px; width: 82px; height: 77px; border: 3px solid #d8dfe7; background: linear-gradient(#f8fafc 0 26%, var(--panel-color, #235b99) 26% 58%, #edf1f5 58%); }
.sp-mini-body::before { content: ''; position: absolute; top: 6px; left: 5px; width: 43px; height: 12px; border-radius: 1px; background: #647284; }
.sp-mini-body::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 11px; height: 1px; background: #aeb8c4; box-shadow: 0 11px 0 #aeb8c4; }
.sp-mini-tray { bottom: 6px; left: 14px; width: 82px; height: 20px; background: var(--panel-color, #235b99); }
.sp-mini .sp-mini-split { display: none; bottom: 6px; left: 40px; width: 2px; height: 20px; background: #dce4ec; }
.sp-mini.is-x9 .sp-mini-split { display: block; }
.sp-mini .sp-mini-finisher { display: none; top: 36px; left: 18px; width: 19px; height: 13px; background: #e0e6ed; box-shadow: inset 0 0 0 1px #9aa8b8; }
.sp-mini.is-finisher .sp-mini-finisher { display: block; }
.sp-mini .sp-mini-external-finisher { display: none; top: 32px; left: -13px; width: 27px; height: 75px; border: 3px solid #d8dfe7; background: linear-gradient(#f8fafc 0 58%, #dfe5ec 58%); }
.sp-mini.is-external-finisher .sp-mini-external-finisher { display: block; }
.sp-preview-btn { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--text); font: 600 12px/1 var(--font); }

/* ── 문의 도우미 ── */
.hb { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hb-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bg); }
.hb-wait { margin: 24px 0; color: #475467; text-align: center; }
.hb-msg { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.hb-msg p { margin: 0 0 6px; }
.hb-msg p:last-child { margin-bottom: 0; }
.hb-me { align-self: flex-end; max-width: 85%; background: #f3f5f8; border-color: var(--line-strong); white-space: pre-wrap; }
.hb-bot h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; line-height: 1.4; }
.hb-cat { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.hb-quote { padding: 6px 10px; border-radius: 6px; background: #f3f5f8; font-size: 13px; }
.hb-quote span { display: block; color: var(--muted); font-size: 12px; }
.hb-steps { margin: 4px 0 6px; padding-left: 22px; }
.hb-steps li { margin: 3px 0; }
.hb-note { padding-left: 10px; border-left: 3px solid var(--line-strong); color: #475467; font-size: 13px; }
.hb-src { margin-top: 8px; color: var(--muted); font-size: 12px; }
.hb-label { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.hb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hb-chips.is-list { flex-direction: column; align-items: stretch; }
.hb-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 16px; background: #fff; color: var(--text); font: 500 13px/1.35 var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.hb-chip:hover { border-color: #8c96a6; }
.hb-chips.is-list .hb-chip { border-radius: 8px; }
.hb-chip.is-primary { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.hb-chip.is-ghost { border-color: transparent; background: none; color: #475467; }
.hb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hb-more { margin-top: 4px; }
.hb-clear { align-self: center; }
.hb-form { flex: none; display: flex; gap: 8px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
/* 16px: 휴대폰 브라우저가 입력할 때 화면을 확대하지 않는 크기 */
.hb-input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); font: 400 16px/1 var(--font); }
.hb-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hb-send { flex: none; height: 42px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: 600 14px/1 var(--font); }

@media (pointer: coarse) {
  .sp-btn, #sp-tour-replay, .sp-tour-actions button, .sp-room-picker button,
  .sp-series-item button, .sp-series-item .sp-finisher-focus, .sp-preview-btn, .hb-chip, .hb-input, .hb-send { min-height: 44px; }
  .sp-swatches button { width: 44px; height: 44px; }
}

/* ── 좁은 화면: 두 칸을 탭으로 ── */
@media (max-width: 900px) {
  .sp-top { height: 48px; padding: 0 10px; gap: 8px; }
  .sp-top h1 { font-size: 15px; }
  .sp-btn { height: 34px; padding: 0 8px; font-size: 12px; }
  .sp-mfp { overscroll-behavior-y: contain; }
  .sp-stage { flex: 0 0 clamp(360px, 52dvh, 520px); overflow: visible; }
  #sp-canvas { touch-action: pan-y; }
  .sp-chat-head h2, .sp-mfp-head h2 { display: none; }
  .sp-chat-head, .sp-mfp-head { padding: 8px 12px; }
  .hb-log { padding: 10px; }
  .hb-me { max-width: 90%; }
  .hb-chip { min-height: 44px; }
  .hb-input, .hb-send { height: 44px; }
  .hb-card-choice .hb-chip { min-height: 44px; }
}

@media (max-width: 600px) {
  #sp-tour-replay { min-height: 44px; }
  .sp-tour { grid-template-columns: 1fr; }
  .sp-tour-actions { grid-column: 1; grid-row: auto; justify-content: flex-end; margin-top: 5px; }
  .sp-tour-actions button { min-height: 44px; }
  .sp-mini-row { gap: 3px; }
  .sp-mini-slot b { font-size: 11px; }
  .sp-mini-row .sp-mini { margin: 0 auto -12px; transform: scale(.78); }
  .sp-stage:has(.sr-mx-card:not(.is-empty)) { margin-bottom: calc(min(30dvh, 180px) + 12px); }
  .sp-stage .sr-mx-card:not(.is-empty) { top: calc(100% + 8px); bottom: auto; }
  .sp-room-picker button { min-height: 44px; }
  .sp-series { gap: 4px; padding: 0 8px 8px; }
  .sp-series-item { padding: 7px 6px; }
  .sp-series-item button { min-height: 44px; }
  .sp-series-item strong span { display: block; font-size: 12px; }
  .sp-series-item:not(.is-current) .sp-series-links { display: none; }
  .sp-series-item .sp-finisher-focus { min-height: 44px; }
  .sp-series-links a { display: flex; align-items: center; min-height: 44px; font-size: 11px; }
  .sp-colors { flex-wrap: wrap; gap: 5px 9px; }
  .sp-swatches { width: 100%; justify-content: space-between; gap: 4px; }
  .sp-swatches button { width: 44px; height: 44px; }
}
@media (max-width: 760px) {
  .sp-stage .sr-mx-card.is-empty { display: none; }
  .sp-stage .sr-mx-card:not(.is-empty) { max-height: min(30dvh, 180px); overflow-y: auto; }
}

@media (max-width: 560px) {
  .sp-top { height: auto; min-height: 48px; flex-wrap: wrap; row-gap: 6px; padding: 7px 10px; }
  .sp-lang { justify-content: flex-end; }
  .sp-btn { min-width: 44px; min-height: 44px; }
}
@media (max-height: 320px) {
  body[data-tab="chat"] { overflow-y: auto; }
  body[data-tab="chat"] .sp-main, body[data-tab="chat"] .sp-chat,
  body[data-tab="chat"] .hb, body[data-tab="chat"] .hb-log { flex: none; }
  body[data-tab="chat"] .hb-log { overflow: visible; }
}
