/* 안전인 개편안 · 틀에 더한 것만(나머지는 stage/stage.css 그대로)
   - 휴대폰 · 좁은 화면 = 위 띠 + 가로 메뉴(대표 규칙 · 햄버거 대신)
   - 메뉴 숫자 칩 · 고객사 사업장 묶음 · 클린미션 문의 · 시트 · 토스트 · 개발 메모 */
html, body { margin: 0; background: var(--ui-surface, #fff); }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif; -webkit-font-smoothing: antialiased; }

/* LNB 숫자 칩 */
.sw-row .x-nb { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--ui-press, #f2f4f6); color: var(--ui-ink-2, #4e5968); font: 600 12px/22px var(--ui-font, inherit); text-align: center; }
.sw-row .x-nb.is-new { background: var(--ui-ink, #191f28); color: #fff; }
.sw-row[aria-current=page] .x-nb { background: #fff; color: var(--ui-brand, #4c00ff); }
.x-kids .x-kid { min-height: 40px; }
.x-kids { padding-left: 34px; }
.sw-grp { display: flex; align-items: center; }
.sw-grp-btn[aria-current=true] { color: var(--ui-ink, #191f28); font-weight: 600; }
.x-contact { margin: 6px 12px 0; padding-top: 14px; border-top: 1px solid var(--ui-line, #f2f4f6); display: flex; flex-direction: column; gap: 2px; font: 500 13px/1.6 var(--ui-font, inherit); color: var(--ui-ink-2, #4e5968); }
.x-contact p { margin: 0 0 2px; color: var(--ui-ink-3, #8b95a1); }
.x-contact a { color: inherit; text-decoration: none; }

/* 좁은 화면 = 가로 메뉴 */
.x-mnav { display: none; }
@media (max-width: 1100px) {
  .sw-side { display: none; }
  .x-mnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--ui-gutter, 20px); border-bottom: 1px solid var(--ui-line, #f2f4f6); background: var(--ui-surface, #fff); position: sticky; top: var(--sw-top, 76px); z-index: 20; }
  .x-mnav::-webkit-scrollbar { display: none; }
  .x-mnav a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ui-press, #f2f4f6); color: var(--ui-ink-body, #333d4b); font: 500 14px/1 var(--ui-font, inherit); text-decoration: none; white-space: nowrap; }
  .x-mnav a[aria-current=page] { background: var(--ui-ink, #191f28); color: #fff; }
  .x-mnav a b { font: 600 12px/1 var(--ui-font, inherit); color: var(--ui-brand, #4c00ff); }
  .x-mnav a[aria-current=page] b { color: #fff; }
}

/* 지금 스테이지 그대로 */
.x-asis { background: var(--ui-press, #f2f4f6); color: var(--ui-ink-2, #4e5968); padding: 4px 10px; border-radius: 999px; font: 500 13px/1.2 var(--ui-font, inherit); }
.x-shot { margin: 0; border: 1px solid var(--ui-line, #f2f4f6); border-radius: 16px; overflow: hidden; background: #fafbfc; }
.x-shot img { width: 100%; display: block; }
.x-err { color: var(--ui-danger, #e42939); font-weight: 600; }

/* 시트(넓은 화면 = 오른쪽 서랍 · 좁은 화면 = 아래 시트) */
.x-sheet-wrap { position: fixed; inset: 0; z-index: 200; }
.x-sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .2s ease; }
.x-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; transition: transform .28s cubic-bezier(.32, .72, 0, 1), opacity .2s ease; box-shadow: -12px 0 40px rgba(0, 0, 0, .12); }
.x-sheet.is-wide { width: min(760px, 100%); }
.x-sheet-wrap.on .x-sheet-back { opacity: 1; }
.x-sheet-wrap.on .x-sheet { transform: none; opacity: 1; }
.x-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.x-sheet-head h2 { margin: 0; font: 700 20px/1.35 var(--ui-font, inherit); letter-spacing: -.02em; color: var(--ui-ink, #191f28); }
.x-sheet-body { flex: 1; overflow-y: auto; padding: 6px 20px 20px; }
.x-sheet-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ui-line, #f2f4f6); display: flex; gap: 8px; }
.x-sheet-foot > * { flex: 1; }
@media (max-width: 760px) {
  .x-sheet, .x-sheet.is-wide { top: auto; left: 0; width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0; transform: translateY(24px); box-shadow: 0 -12px 40px rgba(0, 0, 0, .12); }
}

/* 토스트 */
.x-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); opacity: 0; z-index: 300; background: var(--ui-ink, #191f28); color: #fff; padding: 12px 18px; border-radius: 14px; font: 500 15px/1.4 var(--ui-font, inherit); pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); }
.x-toast.on { opacity: 1; transform: translate(-50%, 0); }
.x-toast { width: max-content; text-align: center; }
body:has(.x-sheet-wrap) .x-toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

/* 개발 메모(기본 닫힘) */
#memo { position: fixed; top: 86px; right: 16px; width: 340px; max-height: calc(100dvh - 110px); overflow-y: auto; z-index: 150; background: #fff; border: 1px solid var(--ui-line-strong, #e5e8eb); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .14); padding: 4px 16px 16px; }
#memo[hidden] { display: none; }
.x-memo-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; padding: 12px 0 8px; }
.x-memo-head h2 { margin: 0; font: 700 16px/1.3 var(--ui-font, inherit); }
#memo ol { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
#memo li b { display: block; font: 600 14px/1.45 var(--ui-font, inherit); color: var(--ui-ink, #191f28); }
#memo li p { margin: 2px 0 0; font: 400 13px/1.55 var(--ui-font, inherit); color: var(--ui-ink-body, #333d4b); }

/* 고객 웹(1101 이상) = LNB 대신 우측 상단 메뉴(플랫폼식 · 10-20 대표) */
.x-hnav { display: none; }
@media (min-width: 1101px) {
  .market-app.is-customer .sw-side { display: none; }
  .market-app.is-customer .sw { grid-template-columns: minmax(0, 1fr); }
  .market-app.is-customer .x-hnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
  .market-app.is-customer .market-header-actions { margin-left: 8px; }
}
.x-hnav > a, .x-hdd > summary { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 12px; color: var(--ui-ink-body, #333d4b); font: 600 16px/1 var(--ui-font, inherit); letter-spacing: -.02em; text-decoration: none; white-space: nowrap; cursor: pointer; }
.x-hnav > a:hover, .x-hdd > summary:hover { background: var(--ui-press, #f2f4f6); }
.x-hnav > a[aria-current=page], .x-hdd > summary[aria-current=true] { color: var(--ui-ink, #191f28); font-weight: 700; }
.x-hnav b { font: 700 13px/1 var(--ui-font, inherit); color: var(--ui-brand, #4c00ff); }
.x-hdd { position: relative; }
.x-hdd > summary { list-style: none; }
.x-hdd > summary::-webkit-details-marker { display: none; }
.x-hdd > summary > svg { color: var(--ui-ink-3, #8b95a1); transition: transform .2s ease; }
.x-hdd[open] > summary > svg { transform: rotate(180deg); }
.x-hdd-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 220px; display: flex; flex-direction: column; padding: 6px; border-radius: 16px; background: #fff; box-shadow: 0 16px 40px rgba(0, 27, 55, .14), inset 0 0 0 1px var(--ui-line-strong, #e5e8eb); }
.x-hdd-h { margin: 6px 10px 4px; font: 700 13px/1.3 var(--ui-font, inherit); color: var(--ui-ink-3, #8b95a1); }
.x-hdd-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--ui-ink, #191f28); font: 500 15px/1.3 var(--ui-font, inherit); text-decoration: none; }
.x-hdd-menu a:hover { background: var(--ui-press, #f2f4f6); }
.x-hdd-menu a[aria-current=page] { font-weight: 700; background: var(--ui-brand-tint, #f4f0ff); }
.x-hdd-menu .x-hdd-call { margin-top: 4px; border-top: 1px solid var(--ui-line, #f2f4f6); border-radius: 0 0 10px 10px; color: var(--ui-ink-2, #4e5968); }
.x-hdd-menu .x-hdd-call b { color: var(--ui-ink, #191f28); font-weight: 600; }

/* 고객 머리 줄 = 로고 + 계정 아이콘만(10-20 대표 B안) */
.market-app .safety-header-brand-copy > span,.market-app .safety-header-brand-tag { display: none; }
.market-app .am-trigger { width: 44px; height: 44px; min-height: 44px; max-width: none; padding: 0; border: 0; border-radius: 12px; background: none; justify-content: center; }
.market-app .am-trigger > svg:not(:first-child), .market-app .am-trigger .am-name { display: none; }
.market-app .am-trigger > svg:first-child { width: 24px; height: 24px; color: var(--ui-ink-body, #333d4b); }
.market-app .am-trigger:hover { background: var(--ui-press, #f2f4f6); }
.market-app .am-trigger:focus-visible,.market-app .safety-header-brand:focus-visible { outline:2px solid var(--ui-brand); outline-offset:4px; border-radius:12px; }
.market-app.is-operations .market-header-actions { margin-left:auto; }

/* 고객 메뉴 알림 = 빨간 점(아이폰 알림처럼 · 숫자 없음) */
.x-dot { position: relative; top: -7px; flex: none; display: inline-block; width: 7px; height: 7px; margin-left: 2px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 2px #fff; }
.x-mnav a[aria-current=page] .x-dot { box-shadow: 0 0 0 2px var(--ui-ink, #191f28); }
.x-hdd-menu a .x-dot { top: 0; margin-left: auto; }

/* 고객 웹 머리 줄(10-20 대표 "왼쪽에는 자주 쓰는 기능 · 드롭다운은 하나로만 · 버튼이 안 보인다") = 왼쪽 알약 단추 · 오른쪽 펼침 메뉴 하나 */
.x-lnav { display: none; }
@media (min-width: 1101px) {
  .market-app.is-customer .x-lnav { display: flex; align-items: center; gap: 4px; flex: none; }
  .x-lnav-div { width: 1px; height: 22px; margin: 0 12px 0 6px; background: #d1d6db; }
  .x-lnav-a { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; color: var(--ui-ink, #191f28); font: 700 17px/1 var(--ui-font, inherit); letter-spacing: -.02em; text-decoration: none; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
  .x-lnav-a:hover:not([aria-current=page]) { background: var(--ui-press, #f2f4f6); }
  .x-lnav-a[aria-current=page] { background: var(--ui-ink, #191f28); color: #fff; }
  .x-lnav-a:focus-visible { outline: 2px solid var(--ui-brand, #4c00ff); outline-offset: 2px; }
  .x-lnav-a .x-dot { position: absolute; top: 6px; right: 6px; margin: 0; }
  .x-lnav-a[aria-current=page] .x-dot { box-shadow: 0 0 0 2px var(--ui-ink, #191f28); }
  .x-lnav-a.is-out { color: var(--ui-ink-2, #4e5968); font-weight: 600; }
  .market-app.is-customer .x-hnav > .x-hdd > summary { height: 42px; padding: 0 14px 0 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--ui-line-strong, #e5e8eb); color: var(--ui-ink, #191f28); font-weight: 700; }
  .market-app.is-customer .x-hnav > .x-hdd > summary > svg:first-child { color: var(--ui-ink, #191f28); }
  .x-hdd-all { min-width: 460px; padding: 10px; }
  .x-hdd-site { display: flex; align-items: baseline; gap: 8px; margin: 4px 10px 8px; }
  .x-hdd-site b { font: 700 16px/1.3 var(--ui-font, inherit); color: var(--ui-ink, #191f28); }
  .x-hdd-site span { font: 500 13px/1.3 var(--ui-font, inherit); color: var(--ui-ink-3, #8b95a1); }
  .x-hdd-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; padding-top: 6px; box-shadow: inset 0 1px 0 var(--ui-line, #f2f4f6); }
  .x-hdd-sec { display: flex; flex-direction: column; min-width: 0; }
  .x-hdd-sec .x-hdd-h { margin: 8px 10px 4px; }
  .x-hdd-all .x-hdd-call { margin-top: 6px; }
}

/* 머리 줄 3판(대표 10-20 "견적 관리 업체 관리로 바꾸고 내 사업장 왼쪽으로 옮겨") = 왼쪽 알약 셋(내 사업장 = 펼침) · 오른쪽 어드민 */
@media (min-width: 1101px) {
  .x-lnav .x-hdd > summary { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 16px; border-radius: 999px; color: var(--ui-ink, #191f28); font: 700 17px/1 var(--ui-font, inherit); letter-spacing: -.02em; white-space: nowrap; cursor: pointer; list-style: none; }
  .x-lnav .x-hdd > summary::-webkit-details-marker { display: none; }
  .x-lnav .x-hdd > summary:hover { background: var(--ui-press, #f2f4f6); }
  .x-lnav .x-hdd > summary[aria-current=true] { background: var(--ui-ink, #191f28); color: #fff; }
  .x-lnav .x-hdd > summary[aria-current=true] > svg { color: #fff; }
  .x-lnav .x-hdd > summary .x-dot { position: absolute; top: 6px; right: 28px; margin: 0; }
  .x-lnav .x-hdd > summary:focus-visible { outline: 2px solid var(--ui-brand, #4c00ff); outline-offset: 2px; }
  .x-lnav .x-hdd-menu { left: 0; right: auto; }
  .x-hnav-admin { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--ui-ink-2, #4e5968); font: 600 15px/1 var(--ui-font, inherit); text-decoration: none; white-space: nowrap; }
  .x-hnav-admin:hover { background: var(--ui-press, #f2f4f6); color: var(--ui-ink, #191f28); }
  .x-hnav-admin svg { width: 16px; height: 16px; }
}

/* 머리 줄 4판(대표 10-20 "홈 미션은 그대로 두고 우측으로 옮기라고") = 오른쪽 [내 사업장 ▾][견적 관리][업체 관리] 알약 · 왼쪽 = 홈 원래 줄 */
@media (min-width: 1101px) {
  .market-app.is-customer .x-hnav { gap: 4px; }
  .market-app.is-customer .x-hnav > .x-hdd > summary { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 16px; border-radius: 999px; box-shadow: none; color: var(--ui-ink, #191f28); font: 700 17px/1 var(--ui-font, inherit); letter-spacing: -.02em; }
  .market-app.is-customer .x-hnav > .x-hdd > summary:hover { background: var(--ui-press, #f2f4f6); }
  .market-app.is-customer .x-hnav > .x-hdd > summary[aria-current=true] { background: var(--ui-ink, #191f28); color: #fff; }
  .market-app.is-customer .x-hnav > .x-hdd > summary[aria-current=true] > svg { color: #fff; }
  .market-app.is-customer .x-hnav > .x-hdd > summary .x-dot { position: absolute; top: 6px; right: 28px; margin: 0; }
}
/* 오른쪽 알약 = 기존 .x-hnav > a 글자색 · 모서리 규칙보다 앞서게(켜진 알약 글자가 묻히던 것) */
@media (min-width: 1101px) {
  .market-app.is-customer .x-hnav > a.x-lnav-a { height: 40px; padding: 0 16px; border-radius: 999px; color: var(--ui-ink, #191f28); font: 700 17px/1 var(--ui-font, inherit); letter-spacing: -.02em; }
  .market-app.is-customer .x-hnav > a.x-lnav-a:hover:not([aria-current=page]) { background: var(--ui-press, #f2f4f6); }
  .market-app.is-customer .x-hnav > a.x-lnav-a[aria-current=page] { background: var(--ui-ink, #191f28); color: #fff; }
}

/* 내 사업장 + 마이페이지 = 맨 오른쪽 계정 자리 하나(대표 10-21) · PC 만(휴대폰 = 사람 아이콘 → 메뉴 화면) */
.market-app .x-acct { display: none; }
@media (min-width: 1101px) {
  .market-app.is-customer .market-header-actions .am { display: none; }
  .market-app.is-customer .x-acct { display: block; position: relative; }
  .market-app.is-customer .x-acct > summary { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 4px; border-radius: 999px; list-style: none; cursor: pointer; color: var(--ui-ink, #191f28); font: 700 16px/1 var(--ui-font, inherit); letter-spacing: -.02em; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--ui-line-strong, #e5e8eb); }
  .market-app.is-customer .x-acct > summary::-webkit-details-marker { display: none; }
  .market-app.is-customer .x-acct > summary:hover { background: var(--ui-press, #f2f4f6); }
  .market-app.is-customer .x-acct > summary[aria-current=true] { box-shadow: inset 0 0 0 1.5px var(--ui-ink, #191f28); }
  .market-app.is-customer .x-acct > summary > svg { color: var(--ui-ink-3, #8b95a1); transition: transform .2s ease; }
  .market-app.is-customer .x-acct[open] > summary > svg { transform: rotate(180deg); }
  .market-app.is-customer .x-acct-av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #f2f4f6; color: var(--ui-ink, #191f28); }
  .market-app.is-customer .x-acct > summary .x-dot { position: absolute; top: 4px; left: 32px; margin: 0; }
  .market-app.is-customer .x-acct > summary:focus-visible { outline: 2px solid var(--ui-brand, #4c00ff); outline-offset: 2px; }
  .market-app.is-customer .x-acct .x-hdd-menu { right: 0; left: auto; min-width: 420px; }
  .market-app.is-customer .x-acct .x-hdd-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 움직임 한 벌(대표 10-21 "모바일에서 버튼 누르면 밑으로 자연스럽게 내려가는 액션 애니메이션 이런 게 전반적으로 부족") ----------
   APP.reveal(el) · ctx.reveal(el) = 그 칸까지 부드럽게 내려가며 떠오름 · ctx.enter(el) = 떠오름만 · 화면 옮김 = 몸통 떠오름(뒤로 = 옆에서)
   시트 = 휴대폰 아래에서 끝까지 올라오고 닫을 때 내려감 · 누르는 손맛 = 휴대폰에서 눌린 단추가 살짝 들어감 · 알림 문구 = 아래 탭 위 */
@keyframes x-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes x-page { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes x-page-back { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.x-enter { animation: x-enter .26s cubic-bezier(.2, .8, .2, 1) both; }
.x-page { animation: x-page .22s cubic-bezier(.2, .8, .2, 1) both; }
.x-page-back { animation: x-page-back .22s cubic-bezier(.2, .8, .2, 1) both; }
.x-sheet-back { transition: opacity .24s ease; }
.x-sheet { transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .24s ease; }
.x-sheet-wrap.is-out .x-sheet { transition-duration: .22s, .2s; transition-timing-function: cubic-bezier(.4, 0, 1, 1), ease; }
@media (max-width: 760px) {
  .x-sheet, .x-sheet.is-wide { transform: translateY(100%); opacity: 1; }
  .x-sheet-wrap.on .x-sheet { transform: none; }
  .x-sheet-wrap.is-out .x-sheet { transform: translateY(100%); }
}
/* 누르는 손맛 = 따로 쓰는 scale 속성(원래 transform · transition 을 덮지 않음) */
@media (hover: none) {
  .market-app button:not(:disabled):not([aria-disabled="true"]):active, .market-app a[href]:active, .market-app [role="button"]:active, .x-sheet button:not(:disabled):active { scale: .97; }
  .market-app button, .market-app a[href], .market-app [role="button"], .x-sheet button { -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 1100px) { body:has(.x-bottomnav) .x-toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) {
  .x-enter, .x-page, .x-page-back { animation: none; }
  .x-sheet, .x-sheet-back { transition: none; }
}
