/* 승인한 홈의 색·글꼴을 공유하는 앱 하단 탭과 전체 메뉴. */
.x-bottomnav { display:none; }
.s-content-tabs { display:flex; align-items:center; gap:2px; min-height:56px; padding:4px var(--ui-gutter,20px) 8px; box-sizing:border-box; background:var(--ui-surface); box-shadow:inset 0 -1px 0 var(--ui-line); }
.s-content-tab { display:inline-flex; align-items:center; justify-content:center; flex:none; min-width:44px; height:38px; padding:0 14px; border-radius:999px; color:var(--ui-ink); font:700 17px/1 var(--ui-font); letter-spacing:-.02em; text-decoration:none; }
.s-content-tab[aria-current=page] { background:var(--ui-ink); color:#fff; }
.s-content-divider { width:1px; height:18px; margin:0 8px; background:#d1d6db; }
.s-content-admin { display:inline-flex; align-items:center; gap:4px; min-height:38px; padding:0 10px; color:var(--ui-ink); font:700 17px/1 var(--ui-font); letter-spacing:-.02em; text-decoration:none; }
.s-content-tabs a:focus-visible { outline:2px solid var(--ui-brand); outline-offset:2px; }
.x-menu-page { max-width:960px; color:var(--ui-ink); }
.x-menu-page h1 { margin:0 0 24px; font:700 26px/1.4 var(--ui-font); letter-spacing:-.04em; }
.x-menu-account { display:flex; align-items:center; gap:12px; min-height:88px; margin-bottom:32px; padding:18px 20px; border:1px solid var(--ui-line-strong); border-radius:24px; }
.x-menu-avatar { display:grid; place-items:center; flex:none; width:44px; height:44px; border-radius:14px; background:var(--ui-brand-tint); color:var(--ui-brand); }
.x-menu-account strong { flex:1; min-width:0; font:700 18px/1.4 var(--ui-font); overflow-wrap:anywhere; letter-spacing:-.03em; }
.x-menu-account>a { display:grid; place-items:center; flex:none; width:44px; height:44px; color:var(--ui-ink-2); border-radius:12px; }
.x-menu-site { color:var(--ui-ink-2); font:500 13px/1.4 var(--ui-font); max-width:35%; overflow-wrap:anywhere; }
.x-menu-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px; align-items:start; }
.x-menu-group { min-width:0; }
.x-menu-group h2 { margin:0 0 12px; font:700 18px/1.4 var(--ui-font); letter-spacing:-.03em; }
.x-menu-list { padding:0 16px; border:1px solid var(--ui-line-strong); border-radius:20px; }
.x-menu-list>a { display:flex; align-items:center; gap:12px; min-height:60px; padding:12px 0; color:var(--ui-ink); text-decoration:none; font:600 15px/1.4 var(--ui-font); border-bottom:1px solid var(--ui-line); }
.x-menu-list>a:last-child { border:0; }
.x-menu-list>a>span { flex:1; min-width:0; overflow-wrap:anywhere; }
.x-menu-list>a>svg { flex:none; color:var(--ui-ink-2); }
.x-menu-list>a>svg:last-child { color:var(--ui-ink-3); }
.x-menu-page a:focus-visible { outline:2px solid var(--ui-brand); outline-offset:3px; border-radius:10px; }
@media(max-width:1100px) {
  .s-content-admin,.s-content-divider { display:none; }
  #app { --x-tab-height:calc(72px + env(safe-area-inset-bottom,0px)); }
  #app .x-mnav { display:none; }
  #app .market-header-inner { height:80px; min-height:80px; box-sizing:border-box; padding-inline:var(--ui-gutter,20px); align-items:center; }
  #app .market-header-inner .ux1-brand { display:flex; align-items:center; }
  #app .market-header-inner .safety-header-brand { min-height:44px; transform:translateY(4px); }
  #app .market-header-inner .market-header-actions { display:flex; align-items:center; margin-left:auto; }
  #app .market-header-inner .am-trigger { display:flex; align-items:center; justify-content:center; }
  #app>.market-main { padding-bottom:var(--x-tab-height); }
  .x-bottomnav { position:fixed; inset:auto 0 0; z-index:130; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); box-sizing:border-box; min-height:var(--x-tab-height); padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px)); background:var(--ui-surface); border-top:1px solid var(--ui-line-strong); }
  .x-bottomnav-item { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:5px; min-width:0; min-height:59px; border-radius:12px; color:var(--ui-ink-2); font:500 12px/1.25 var(--ui-font); text-decoration:none; -webkit-tap-highlight-color:transparent; transition:color .15s ease,background-color .15s ease; }
  .x-bottomnav-icon { position:relative; display:grid; place-items:center; width:28px; height:28px; }
  .x-bottomnav-item[aria-current=page] { color:var(--ui-ink); font-weight:750; }
  .x-bottomnav-item svg { stroke-width:1.8; }
  .x-bottomnav-item[aria-current=page] svg { stroke-width:2.7; }
  .x-bottomnav-item:active { background:var(--ui-fill); }
  .x-bottomnav-item:focus-visible { outline:2px solid var(--ui-ink); outline-offset:-2px; }
  .x-bottomnav-dot { position:absolute; top:0; right:0; width:6px; height:6px; border-radius:50%; background:var(--ui-danger-dot,#ff3b30); box-shadow:0 0 0 2px var(--ui-surface); }
  .market-app .x-body .sb-layer { bottom:var(--x-tab-height); }
  .market-app .x-body .sb-dfoot { padding-bottom:12px; }
  .market-app .x-body .cq-bar,.market-app .x-body .hd-apg-foot { bottom:var(--x-tab-height); }
  .market-app .x-body .hc-cta { bottom:var(--x-tab-height); padding-bottom:12px; } /* 지도에서 견적 받기 [견적 무료로 받기] = 아래 탭 위로(가림 고침 10-21) */
  body:has(.x-bottomnav) .x-toast { bottom:calc(88px + env(safe-area-inset-bottom,0px)); }
  html { scroll-padding-bottom:calc(88px + env(safe-area-inset-bottom,0px)); }
}
@media(max-width:600px) {
  .x-menu-page { padding-top:24px; }
  .x-menu-groups { grid-template-columns:minmax(0,1fr); gap:28px; }
  .x-menu-account { padding:16px; margin-bottom:28px; }
}
@media(hover:hover) {
  .x-menu-list>a:hover,.x-menu-account>a:hover { color:var(--ui-brand); }
}
@media(prefers-reduced-motion:reduce) {
  .x-bottomnav-item { transition:none; }
}

/* 고객 묶음 탭 줄(견적 관리 · 업체 관리 · 대표 10-20) = 앱 화면(1100 이하)만 · PC 는 우측 상단 펼침 메뉴 */
.x-gtabs { display:none; }
@media(max-width:1100px) {
  .x-gtabs { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .x-gtabs::-webkit-scrollbar { display:none; }
  .x-gtabs .s-content-tab { position:relative; font-size:16px; padding:0 14px; }
  .x-gtabs .x-dot { position:absolute; top:6px; right:4px; }
}

/* PC 도 묶음 탭 줄(머리 줄 아래 · 밑줄 탭 · 홈 '내 주변 지정기관' 탭 문법) · 휴대폰은 알약 그대로 */
@media(min-width:1101px) {
  .x-gtabs { display:flex; gap:28px; min-height:0; padding:0 max(40px, calc((100% - 1240px) / 2)); background:#fff; box-shadow:inset 0 -1px 0 var(--ui-line-strong,#e5e8eb); }
  .x-gtabs .s-content-tab { position:relative; height:52px; min-width:0; padding:0 2px; border-radius:0; background:none; color:var(--ui-ink-3,#8b95a1); font:600 16px/1 var(--ui-font); }
  .x-gtabs .s-content-tab:hover { color:var(--ui-ink,#191f28); }
  .x-gtabs .s-content-tab[aria-current=page] { background:none; color:var(--ui-ink,#191f28); font-weight:700; box-shadow:inset 0 -2px 0 var(--ui-ink,#191f28); }
  .x-gtabs .x-dot { position:absolute; top:12px; right:-8px; }
}

/* ---------- 고객 '내 사업장'(대표 10-21 "메뉴 줄일 수 있는 건 줄이고 ui") = 사업장 카드 + 큰 칸 셋 + 줄 셋 ---------- */
.x-body .sw-view.x-mine { max-width: 600px; display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.x-mine-h { margin: 0 0 4px; font: 700 24px/1.35 var(--ui-font); letter-spacing: -.03em; color: var(--ui-ink); }
.x-mine-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px 18px; border-radius: 22px; background: radial-gradient(90% 140% at 100% 0%, #e6deff 0%, rgba(230, 222, 255, 0) 60%), linear-gradient(135deg, #f4f0ff 0%, #eef3ff 100%); }
.x-mine-av { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #fff; box-shadow: 0 4px 12px rgba(76, 0, 255, .08); }
.x-mine-card b { flex: 1; min-width: 0; font: 700 18px/1.35 var(--ui-font); letter-spacing: -.03em; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-mine-tag { flex: none; height: 26px; padding: 0 10px; border-radius: 8px; background: #fff; color: var(--ui-ink-2); font: 700 13px/26px var(--ui-font); }
.x-mine-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.x-mine-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 116px; padding: 16px 14px 14px; border-radius: 20px; background: #f4f5f7; color: var(--ui-ink); text-decoration: none; transition: background-color .2s ease, transform .14s cubic-bezier(.22, 1, .36, 1); }
.x-mine-tile:hover { background: #eceef1; }
.x-mine-tile:active { transform: scale(.97); }
.x-mine-tile:focus-visible { outline: 2px solid var(--ui-brand); outline-offset: 2px; }
.x-mine-ic img { display: block; width: 40px; height: 40px; }
.x-mine-tile b { font: 700 16px/1.3 var(--ui-font); letter-spacing: -.02em; }
.x-mine-tile > .x-dot { position: absolute; top: 14px; right: 14px; margin: 0; }
.x-mine-list { display: flex; flex-direction: column; border: 1px solid var(--ui-line-strong); border-radius: 20px; overflow: hidden; }
.x-mine-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px; color: var(--ui-ink); text-decoration: none; font: 600 15.5px/1.3 var(--ui-font); background: #fff; }
.x-mine-row + .x-mine-row { border-top: 1px solid var(--ui-line); }
.x-mine-row > svg:first-child { flex: none; color: var(--ui-ink-2); }
.x-mine-row > span { flex: 1; min-width: 0; }
.x-mine-row > svg:last-child { flex: none; color: var(--ui-ink-3); }
a.x-mine-row:hover { background: #fafafb; }
.x-mine-row:focus-visible, .x-mine-btn:focus-visible { outline: 2px solid var(--ui-brand); outline-offset: -2px; }
.x-mine-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: 11px; background: #f4f5f7; color: var(--ui-ink); font: 700 13.5px/1 var(--ui-font); text-decoration: none; }
.x-mine-btn svg { color: var(--ui-brand); }
.x-mine-btn:hover { background: #eceef1; }
@media (max-width: 420px) {
  .x-mine-tiles { gap: 8px; }
  .x-mine-tile { min-height: 104px; padding: 14px 12px 12px; }
  .x-mine-ic img { width: 36px; height: 36px; }
  .x-mine-tile b { font-size: 15px; }
  .x-mine-btn { padding: 0 10px; }
}

/* ---------- 고객 공용 부품(10-21 대표 "뒤로가기 버튼 요런 것들도 없네~ 디테일이 좀 많이 부족해") ---------- */
/* 뒤로가기 = app.js backHTML 한 부품 · 휴대폰 = 왼쪽 위 같은 자리 · PC = 본문 왼쪽 위 같은 줄(위 경로) */
.x-body .dl-top.x-back { display: flex; align-items: center; gap: 0; height: 44px; margin: 0 0 8px -12px; }
.x-body .x-back .dl-back { width: 44px; height: 44px; color: var(--ui-ink, #191f28); border-radius: 12px; }
.x-body .x-back .dl-back svg { width: 24px; height: 24px; }
.x-body .x-back .dl-top-t { display: inline-flex; align-items: center; height: 44px; padding: 0 10px 0 0; font: 600 15px/1 var(--ui-font, inherit); letter-spacing: -.01em; color: var(--ui-ink-2, #4e5968); text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .x-body .x-back .dl-back:hover { background: var(--ui-press, #f2f4f6); } .x-body .x-back .dl-top-t:hover { color: var(--ui-ink, #191f28); } }
.x-body .x-back .dl-back:focus-visible, .x-body .x-back .dl-top-t:focus-visible { outline: 2px solid var(--ui-brand, #4c00ff); outline-offset: 2px; }

/* 잠금 · 빈 상태 = 입체 아이콘 + 한 줄 + 할 일 단추 하나 */
.x-body .x-lock { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 22px 28px; border: 0; border-radius: 24px; background: #f7f8fa; box-shadow: none; text-align: center; }
.x-body .x-lock .ca-lock-in { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0; }
.x-body .x-lock-ic { display: block; width: 56px; height: 56px; }
.x-body .x-lock .dl-lock-t, .x-body .x-lock .ca-lock-t { flex: none; max-width: 22em; font: 700 17px/1.45 var(--ui-font, inherit); letter-spacing: -.02em; color: var(--ui-ink, #191f28); word-break: keep-all; }
.x-body .x-lock .x-lock-btn { flex: none; width: auto; min-width: 168px; margin-top: 4px; text-decoration: none; }
.x-body .x-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; border-radius: 24px; background: #f7f8fa; text-align: center; }
.x-body .x-empty img { display: block; width: 56px; height: 56px; }
.x-body .x-empty b { font: 700 17px/1.45 var(--ui-font, inherit); letter-spacing: -.02em; color: var(--ui-ink, #191f28); word-break: keep-all; }
.x-body .x-empty .ui-btn { width: auto; min-width: 168px; text-decoration: none; }

/* 못 그린 화면 = 입체 아이콘 + 한 줄 + [다시] */
.x-body .x-fail-in { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; padding: 40px 20px; border-radius: 24px; background: #f7f8fa; text-align: center; }
.x-body .x-fail-in .x-err { margin: 0; font: 700 17px/1.45 var(--ui-font, inherit); color: var(--ui-ink, #191f28); }
.x-body .x-fail-btn { width: auto; min-width: 120px; }
@media (max-width: 760px) {
  .x-body .x-lock .ca-lock-in { align-self: stretch; padding: 0; }
  .x-body .x-lock .x-lock-btn, .x-body .x-empty .ui-btn { align-self: stretch; width: 100%; }
}
/* 뒤로 줄이 맨 위인 화면 = 같은 높이(휴대폰 20 · PC 28 위 여백) · 신청 · 업체 정보 · 업체 관리 기능 판도 같은 자리 */
.x-body .sw-view.hd-apg, .x-body .sw-view.hd-agp { padding-top: 20px; }
.x-body .hd-apg-top, .x-body .hd-agp-top { margin-left: -12px; min-height: 44px; }
.x-body .ca-fv > .dl-top.x-back { margin-bottom: -14px; }
.x-body .cs-page > .cs-noprint > .dl-top.x-back { margin-bottom: 0; }
.x-body .cs-page > .cs-noprint:has(> .x-back) + .sw-head { margin-top: -8px; }
.x-body .ca-rec-b .x-back, .x-body [data-sec] .x-back { display: none; }
@media (min-width: 761px) { .x-body .sw-view.hd-apg, .x-body .sw-view.hd-agp { padding-top: 28px; } }
@media (max-width: 760px) {
  .x-body .ca-ag3.has-fn .ca-dt { padding: 0; border-radius: 0; box-shadow: none; background: none; }
  .x-body .ca-ag3.has-fn .ca-dt > .ca-rc-h { min-height: 44px; padding-bottom: 12px; }
  .x-body .ca-dt-back { margin-left: -12px; }
}

/* ---------- 스크롤 다듬기(10-21 대표 "스크롤 시 부자연스러운 것도 다 잡아야 할 듯") ---------- */
/* 안쪽 스크롤 칸 = 끝까지 굴려도 바깥 화면이 같이 안 굴러감 */
.x-sheet-body, .x-body .dl-msgs, .x-body .ca-ml, .x-hdd-menu, #memo { overscroll-behavior: contain; }
.x-gtabs, .x-body .ui-seg, .x-body .hd-rail, .x-body .cq-tray-wrap { overscroll-behavior-x: contain; }
/* 시트 열림 = 뒤 화면 잠금(app.js lockScroll · body 고정) · 딤을 끌어도 뒤 화면 안 굴러감 */
html.x-lock { overflow: hidden; }
/* 스크롤바가 자리를 차지하는 PC(윈도 등) = 잠그면 사라지는 폭만큼 메움(뒤 화면 · 아래 탭이 옆으로 밀리던 것) */
html.x-lock body { padding-right: var(--x-sbw, 0px); box-sizing: border-box; }
@media (max-width: 1100px) { html.x-lock .x-bottomnav { padding-right: calc(max(8px, env(safe-area-inset-right, 0px)) + var(--x-sbw, 0px)); } }
.x-sheet-back { touch-action: none; }
@media (max-width: 1100px) {
  /* 짧은 화면 = 아래 탭 자리를 두 번 세서 72px 빈 스크롤이 생기던 것(.sw 최소 높이 + 본문 아래 여백) */
  #app .sw { min-height: calc(100dvh - var(--sw-top, 80px) - var(--x-tab-height, 72px)); }
  /* 키보드 = 따로 안 건드림(휴대폰 기본 = 화면 아래 탭이 키보드 밑으로 들어감 · focus 때 아래 탭을 숨기면 [다음]을 누르는 순간 화면이 움직여 빗나감 · 10-21 점검) */
}
@media (max-width: 760px) {
  /* 업체와 대화(c/chat) = 대화 판이 화면 남은 높이에 딱 맞음 · 입력칸 늘 아래 탭 위(업체 관리 대화 판과 같은 짜임) */
  #x-body > .sw-view.dl-chatv { display: flex; flex-direction: column; box-sizing: border-box; height: calc(100dvh - var(--sw-top, 80px) - var(--x-tab-height, 72px)); min-height: 420px; padding-bottom: 12px; }
  #x-body > .sw-view.dl-chatv > .dl-chat { flex: 1; min-height: 0; margin-bottom: 0; }
  #x-body > .sw-view.dl-chatv .dl-msgs { flex: 1; min-height: 0; max-height: none; }
}
