/* 페이스튜디오 모바일 웹앱(pay) — POS 화이트, 큰 글씨 · 큰 터치 영역(어르신 접근성) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 스크롤은 되되 스크롤바는 숨김 — 모바일 앱 느낌 + 랜딩 iframe 안 우측 스크롤바 제거 */
* {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}
*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;                  /* Chrome/Safari */
}

:root {
    --pm-green: #0f9d6e;
    --pm-green-d: #0c7d57;
    --pm-soft: #e7f6f0;
    --pm-text: #1f2933;
    --pm-sub: #6b7787;
    --pm-muted: #9aa4b2;
    --pm-line: #edf0f3;
    --pm-line2: #f0f2f5;
    --pm-bg: #f4f6f8;
    --pm-card: #ffffff;
    --pm-danger: #e24b4a;
}

html,
body {
    background: var(--pm-bg);
}

body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    color: var(--pm-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

i {
    font-style: normal;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    /* iOS 탭 반응 개선 — 더블탭 줌 감지 지연(약 300ms) 제거 + 선택/콜아웃 차단으로 버벅임 방지 */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

ul {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ===== 셸 ===== */
.pm-app {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--pm-bg);
}

/* ===== 헤더 (로고 + 업체명 + 알림) ===== */
.pm-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 58px;
    padding: 0 16px;
    background: var(--pm-card);
    border-bottom: 1px solid var(--pm-line);
}

.pm-header__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pm-header__logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--pm-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    flex: none;
}

.pm-header__brand strong {
    font-size: 17px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 헤더 브랜드 — 사업장 2개 이상이면 클릭 가능 칩 + chevron */
.pm-header__brand--switch {
    background: #f7f8fa;
    border-radius: 12px;
    padding: 5px 11px 5px 6px;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.pm-header__brand--switch:active {
    background: #eef0f3;
}

.pm-header__chev {
    font-size: 14px;
    color: var(--pm-sub);
    margin-left: 1px;
    flex: none;
}

/* 하위 페이지 헤더 — 뒤로 + 가운데 타이틀 + 우측 여백(중앙 정렬용) */
.pm-header__title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
}

.pm-header__spacer {
    width: 40px;
    flex: none;
}

.pm-iconbtn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    color: var(--pm-sub);
    font-size: 20px;
    box-shadow: 0 2px 6px rgba(31, 41, 51, .04);
}

.pm-iconbtn--ghost {
    background: transparent;
    border: none;
    box-shadow: none;
}

.pm-iconbtn__dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pm-danger);
    border: 2px solid var(--pm-card);
}

/* ===== 본문 ===== */
.pm-main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pm-home {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 매출 스와이프 (이번 달 / 올해) — dot 은 카드 위 오버레이(흰색) */
.pm-sales__view {
    position: relative;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(10, 87, 64, .18);
}

.pm-sales__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 18px;
}

.pm-sales__track::-webkit-scrollbar {
    display: none;
}

.pm-sales__card {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: center;
    background: linear-gradient(140deg, #13a87b, #0a5740);
    color: #fff;
    padding: 17px 19px 28px;
    overflow: hidden;
}

.pm-sales__card--year {
    background: linear-gradient(140deg, #2f9e8f, #11534a);
}

.pm-sales__shine {
    position: absolute;
    top: -10%;
    right: -18px;
    width: 90px;
    height: 120%;
    background: rgba(255, 255, 255, .07);
    border-radius: 40px;
    transform: rotate(8deg);
    pointer-events: none;
}

.pm-sales__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 21px;
}

.pm-sales__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: .92;
}

.pm-sales__label i {
    font-size: 15px;
    opacity: .85;
}

.pm-sales__badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, .18);
    padding: 4px 10px;
    border-radius: 11px;
    letter-spacing: -.2px;
}

.pm-sales__badge i {
    font-size: 13px;
}

/* 상승/하락 구분 — 배경 톤만 살짝 다르게(흰 카드 위 가독성 유지) */
.pm-sales__badge--up {
    background: rgba(255, 255, 255, .22);
}

.pm-sales__badge--down {
    background: rgba(255, 199, 200, .25);
}

.pm-sales__amount {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -1.2px;
    margin: 9px 0 6px;
}

.pm-sales__amount span {
    font-size: 16px;
    font-weight: 500;
    margin-left: 2px;
    letter-spacing: 0;
}

.pm-sales__meta {
    font-size: 12px;
    opacity: .9;
}

/* 매출 카드 미니 sparkline — 추세선 + 마지막 점 글로우 */
.pm-sales__chart {
    position: relative;
    margin-top: 8px;
    height: 38px;
    pointer-events: none;
}

.pm-sales__chart svg {
    display: block;
    width: 100%;
    height: 38px;
}

.pm-sales__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 13px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pm-dot {
    width: 5px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .4);
    transition: width .25s, background .25s;
}

.pm-dot.is-on {
    width: 16px;
    background: #fff;
}

.pm-sales__hint {
    text-align: center;
    font-size: 12px;
    color: var(--pm-muted);
    margin-top: 9px;
}

/* 바로가기 4 */
.pm-quick {
    background: var(--pm-card);
    border-radius: 16px;
    padding: 7px 4px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: 0 2px 10px rgba(31, 41, 51, .05);
}

.pm-quick__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 10px 0;
    font-size: 12px;
    color: var(--pm-text);
    transition: transform .1s;
}

.pm-quick__item:active {
    transform: scale(.96);
}

.pm-quick__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--pm-soft);
    color: var(--pm-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
}

/* 바로가기 메뉴별 시그니처 컬러 — 옅은 배경 + 진한 아이콘 */
.pm-quick__icon--blue {
    background: #eaf3ff;
    color: #2a8be0;
}

.pm-quick__icon--green {
    background: var(--pm-soft);
    color: var(--pm-green);
}

.pm-quick__icon--orange {
    background: #fff4e1;
    color: #d97706;
}

.pm-quick__icon--purple {
    background: #f3edff;
    color: #7c3aed;
}

/* 블록(최근거래 · 공지 공통 카드) */
.pm-block {
    background: var(--pm-card);
    border-radius: 16px;
    padding: 15px 17px;
    box-shadow: 0 2px 10px rgba(31, 41, 51, .05);
}

.pm-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.pm-block__head strong {
    font-size: 15px;
    font-weight: 600;
}

.pm-block__more {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: var(--pm-muted);
}

.pm-empty {
    text-align: center;
    color: var(--pm-muted);
    font-size: 13px;
    padding: 16px 0;
}

/* 최근 거래 */
.pm-recent__item {
    border-bottom: 1px solid var(--pm-line2);
}

.pm-recent__item:last-child {
    border-bottom: none;
}

/* 상세 진입 링크 — flex 컨테이너 역할 흡수 */
.pm-recent__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.pm-recent__link:active {
    background: var(--pm-line2);
    border-radius: 8px;
    margin: 0 -6px;
    padding-left: 6px;
    padding-right: 6px;
}

.pm-recent__icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--pm-soft);
    color: var(--pm-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
}

.pm-recent__body {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.pm-recent__body b {
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-recent__body span {
    font-size: 12px;
    color: var(--pm-muted);
}

/* 결제 메타 앞 작은 그린 도트 — 결제완료 상태 시각 신호 */
.pm-recent__body span::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pm-green);
    margin-right: 5px;
    vertical-align: 1px;
}

.pm-recent__price {
    font-weight: 700;
    font-size: 14px;
    flex: none;
}

/* 결제 방식별 아이콘 컬러(데이터 o.tone 으로 분기) */
.pm-recent__icon--green {
    background: var(--pm-soft);
    color: var(--pm-green);
}

.pm-recent__icon--blue {
    background: #eaf3ff;
    color: #2a8be0;
}

.pm-recent__icon--orange {
    background: #fff4e1;
    color: #d97706;
}

.pm-recent__icon--purple {
    background: #f3edff;
    color: #7c3aed;
}

/* 첫 행(가장 최근) 강조 — 옅은 페이그린 + 금액 그린 */
.pm-recent__item--hot {
    margin: 0 -10px;
    padding: 0 10px;
    border-radius: 12px;
    background: #f5fffb;
    border-bottom: 0;
}

/* hot 안의 link 는 자체 padding 으로 클릭 영역 확보 (item--hot 은 padding 0 으로 둠) */
.pm-recent__item--hot .pm-recent__link:active {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    background: rgba(15, 157, 110, .08);
}

.pm-recent__price--hot {
    color: var(--pm-green-d);
    font-weight: 800;
}

/* 공지사항 (썸네일 없이 제목 + 날짜) */
.pm-notice__item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 0;
    border-bottom: 1px solid var(--pm-line2);
}

.pm-notice__item:last-child a {
    border-bottom: none;
}

.pm-notice__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pm-green);
    flex: none;
}

.pm-notice__dot.is-off {
    background: transparent;
}

/* 새 공지 NEW 배지 — 가장 강한 시각 신호(빨강) */
.pm-notice__new {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #ffffff;
    background: var(--pm-danger);
    padding: 3px 6px;
    border-radius: 5px;
    line-height: 1;
}

.pm-notice__title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-notice__date {
    font-size: 12px;
    color: var(--pm-muted);
    flex: none;
}

/* ===== 하단 탭바 (홈 · 내역 · 결제 · 인사이트 · 마이) ===== */
.pm-tabbar {
    flex: none;
    display: flex;
    align-items: flex-end;
    background: var(--pm-card);
    border-top: 1px solid var(--pm-line);
}

.pm-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--pm-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 2px;
}

.pm-tab i {
    font-size: 23px;
}

.pm-tab.is-active {
    color: var(--pm-green);
}

.pm-tab--main {
    color: var(--pm-green);
}

.pm-tab__fab {
    width: 50px;
    height: 50px;
    border-radius: 17px;
    background: var(--pm-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    margin-top: -20px;
    box-shadow: 0 6px 16px rgba(15, 157, 110, .35);
    z-index: 10;
}

/* ===== 준비중 ===== */
.pm-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 9px;
    padding: 40px 24px;
}

.pm-placeholder__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--pm-soft);
    color: var(--pm-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin-bottom: 8px;
}

.pm-placeholder strong {
    font-size: 19px;
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════
   사업장 전환 시트 — pmws (헤더 브랜드 / 마이페이지 둘 다 호출)
   ════════════════════════════════════════════════════════ */

.pmws-sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear .28s;
}

.pmws-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
    transition: visibility 0s linear;
}

.pmws-sheet__dim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    transition: opacity .25s ease;
}

.pmws-sheet.is-open .pmws-sheet__dim {
    opacity: 1;
}

.pmws-sheet__panel {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    transform: translate(-50%, 100%);
    background: #ffffff;
    border-radius: 22px 22px 0 0;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 78%;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, .18);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.pmws-sheet.is-open .pmws-sheet__panel {
    transform: translate(-50%, 0);
}

.pmws-sheet__bar {
    width: 38px;
    height: 4px;
    background: var(--pm-line);
    border-radius: 2px;
    margin: 0 auto;
    flex: none;
}

.pmws-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pmws-sheet__head strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--pm-text);
}

.pmws-sheet__x {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--pm-sub);
    font-size: 20px;
    cursor: pointer;
}

/* 사업장 리스트 */
.pmws-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.pmws-list li {
    list-style: none;
}

.pmws-li {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--pm-line);
    background: #ffffff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .12s, background .15s, border-color .15s;
}

.pmws-li:active {
    transform: scale(.985);
    background: #f7f8fa;
}

.pmws-li.is-on {
    border-color: var(--pm-green);
    background: #f7fdfa;
}

.pmws-li__bd {
    display: block;
    flex: 1;
    min-width: 0;
}

.pmws-li__bd b {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--pm-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pmws-li__bd small {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--pm-muted);
    letter-spacing: -.1px;
}

.pmws-li__check {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--pm-green);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex: none;
}

.pmws-li__chev {
    color: #cbd2dc;
    font-size: 18px;
    flex: none;
}

.pm-placeholder__desc {
    font-size: 14px;
    color: var(--pm-sub);
}
