/*
 * 마켓 첫 화면(/m/{마켓코드}) — 시안 B-1(몰입형 매거진).
 * 마켓 테마 색은 <body style="--brand: #RRGGBB"> 로 들어온다.
 */
:root {
  --ink: #0c1b24;
  --paper: #f5f1ea;
  --on-ink: #f5f1ea;
  --on-ink-soft: rgba(245, 241, 234, .74);
  --on-paper-soft: #4a5a63;
  --line-ink: rgba(245, 241, 234, .16);
  --line-paper: rgba(12, 27, 36, .16);
  --wrap: 1280px;
  --gut: 40px;
}
/*
 * 흰 글자를 얹거나 종이색 위에 글자로 쓰는 테마 색. 밝은 테마 색(노랑 등)에서도 읽히도록
 * 밝기를 눌러 쓴다. 상대 색 문법을 모르는 옛 브라우저는 잉크색으로 떨어진다.
 * --brand 가 body 에 걸리므로 :root 가 아니라 body 에서 계산한다.
 */
body { --brand-deep: var(--ink); }
@supports (color: oklch(from red min(l, .5) c h)) {
  body { --brand-deep: oklch(from var(--brand) min(l, .5) c h); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--paper); color: var(--ink);
  font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 3px; }
.hero :focus-visible, .ft :focus-visible { outline-color: #fff; }
.tile:focus-visible { outline-color: var(--ink); outline-offset: -6px; box-shadow: inset 0 0 0 3px #fff; }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 18px; background: var(--paper); color: var(--ink); font-weight: 800; border-radius: 8px; }
.skip:focus { top: 12px; }

/* 대표 사진 + 헤더. 대표 사진이 없으면 테마 색 바탕(.hero--plain)으로 같은 구성 */
.hero { position: relative; min-height: 640px; display: flex; flex-direction: column; background: var(--ink); color: #fff; overflow: hidden; }
.hero--plain { background: var(--brand); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 27, 36, .74) 0, rgba(12, 27, 36, 0) 26%),
    linear-gradient(0deg, rgba(12, 27, 36, .94) 0, rgba(12, 27, 36, .62) 34%, rgba(12, 27, 36, 0) 68%);
}
/* 밝은 테마 색에서도 흰 글자가 읽히도록 전체를 한 겹 더 누른다 */
.hero--plain::before {
  background:
    linear-gradient(180deg, rgba(12, 27, 36, .62) 0, rgba(12, 27, 36, 0) 30%),
    linear-gradient(0deg, rgba(12, 27, 36, .9) 0, rgba(12, 27, 36, .6) 40%, rgba(12, 27, 36, .2) 100%);
}
.hero-mark { position: absolute; right: 4%; top: 16%; width: 40%; max-width: 520px; color: #fff; opacity: .13; transform: rotate(-10deg); }
.hero-mark svg { display: block; width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.hd { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; height: 84px; }
.hd-home { display: grid; place-items: center; width: 44px; height: 44px; flex: none; margin-left: -8px; }
.hd-home svg { width: 28px; height: 31px; }
.hd-name { min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-home + .hd-name { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .5); }
/* 로고는 흰 바탕용으로 만든 것이 대부분이라 종이색 판 위에 올린다 */
.hd-logo { display: flex; align-items: center; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px; background: var(--paper); }
.hd-logo img { display: block; height: 28px; width: auto; max-width: min(200px, 44vw); object-fit: contain; }
.hd-pay { display: inline-flex; align-items: center; gap: 7px; flex: none; margin-left: auto; height: 46px; padding: 0 20px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 800; white-space: nowrap; }
.hero-txt { position: relative; z-index: 2; margin-top: auto; padding-top: 80px; padding-bottom: 56px; }
.hero-count { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.hero-count::before { content: ""; width: 36px; height: 4px; background: var(--brand); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.hero h1 { max-width: 1000px; margin-top: 16px; font-size: clamp(46px, 7.2vw, 104px); font-weight: 900; line-height: 1.04; letter-spacing: -.055em; text-wrap: balance; }
/* 단어 단위로 줄이 바뀌고, 한 줄보다 긴 단어만 안에서 끊긴다 */
.hero h1 span { display: inline-block; max-width: 100%; }
.hero h1.h1--s { font-size: clamp(54px, 8.6vw, 124px); }
.hero h1.h1--l { font-size: clamp(38px, 5.6vw, 80px); line-height: 1.08; }
.hero h1.h1--xl { font-size: clamp(30px, 4.2vw, 60px); line-height: 1.14; letter-spacing: -.045em; }

/* 소개 본문 — 에디터가 만든 HTML */
.intro { padding-top: 56px; }
.market-body { max-width: 760px; font-size: 17px; line-height: 1.75; color: var(--on-paper-soft); }
.market-body > :first-child { margin-top: 0; }
.market-body > :last-child { margin-bottom: 0; }
.market-body p { margin: 0 0 .8em; }
.market-body h1, .market-body h2, .market-body h3, .market-body h4 { margin: 1.5em 0 .5em; color: var(--ink); font-weight: 800; line-height: 1.3; letter-spacing: -.03em; }
.market-body h1, .market-body h2 { font-size: 1.5em; }
.market-body h3 { font-size: 1.25em; }
.market-body h4 { font-size: 1.08em; }
.market-body ul, .market-body ol { margin: 0 0 .8em; padding-left: 1.3em; }
.market-body ul { list-style: disc; }
.market-body ol { list-style: decimal; }
.market-body li { margin: .2em 0; }
.market-body img { display: block; max-width: 100%; height: auto; margin: 1.2em 0; }
.market-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.market-body strong, .market-body b { color: var(--ink); font-weight: 800; }
.market-body blockquote { margin: 0 0 .8em; padding-left: 1em; border-left: 4px solid var(--brand); }
.market-body hr { margin: 1.5em 0; border: 0; border-top: 1px solid var(--line-paper); }
.market-body table { max-width: 100%; border-collapse: collapse; margin: 0 0 .8em; }
.market-body th, .market-body td { padding: 8px 12px; border: 1px solid var(--line-paper); text-align: left; }

/* 분류 탭 — 스크롤하면 붙는다 */
.tabs { position: sticky; top: 0; z-index: 10; margin-top: 40px; background: var(--paper); border-bottom: 1px solid var(--line-paper); }
.tabs ul { display: flex; gap: 8px; height: 68px; align-items: center; overflow-x: auto; scrollbar-width: none; list-style: none; }
.tabs ul::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: 16px; font-weight: 800; white-space: nowrap; }
.tabs a[aria-current] { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.hero + .tabs { margin-top: 0; }
.tabs small { font-size: 13px; font-weight: 700; opacity: .8; font-variant-numeric: tabular-nums; }

/* 상품 */
main.wrap { flex: 1; padding-bottom: 104px; }
.cat { padding-top: 72px; scroll-margin-top: 68px; }
.tabs + main > .cat:first-child { padding-top: 48px; }
.cat-hd { display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.cat-hd h2 { font-size: 56px; font-weight: 900; line-height: 1.1; letter-spacing: -.05em; }
.cat-hd span { flex: none; font-size: 18px; font-weight: 800; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 300px; gap: 12px; }
.tile { position: relative; display: block; overflow: hidden; background: var(--brand); color: #fff; }
.tile > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tile:hover > img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .tile > img { transition: none; } .tile:hover > img { transform: none; } }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12, 27, 36, .92) 0, rgba(12, 27, 36, .55) 30%, rgba(12, 27, 36, 0) 58%); }
/* 이미지 없는 상품 — 테마 색 바탕에 티켓 모양. 밝은 테마 색 대비용으로 한 겹 더 누른다 */
.tile--noimg::after { background: linear-gradient(0deg, rgba(12, 27, 36, .9) 0, rgba(12, 27, 36, .58) 36%, rgba(12, 27, 36, .14) 100%); }
.tile-ticket { position: absolute; left: 50%; top: 36%; width: min(46%, 240px); color: #fff; opacity: .5; transform: translate(-50%, -50%) rotate(-8deg); }
.tile-ticket svg { display: block; width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.tile-open { position: absolute; z-index: 2; left: 16px; top: 16px; padding: 6px 12px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 800; }
.tile-txt { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 20px 76px 20px 20px; }
.tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 22px; font-weight: 800; line-height: 1.22; letter-spacing: -.04em; }
.tile-price { display: block; margin-top: 4px; font-size: 22px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-price small { font-size: .7em; font-weight: 700; margin-left: 1px; }
.tile-go { position: absolute; z-index: 2; right: 16px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-deep); border: 1.5px solid rgba(255, 255, 255, .85); display: grid; place-items: center; }
/* 비대칭: 첫 상품 크게 */
.grid > .tile:first-child { grid-row: span 2; }
.grid > .tile:first-child .tile-txt { padding: 32px 96px 32px 32px; }
.grid > .tile:first-child .tile-name { font-size: 44px; line-height: 1.12; letter-spacing: -.05em; }
.grid > .tile:first-child .tile-price { margin-top: 8px; font-size: 30px; }
.grid > .tile:first-child .tile-go { right: 28px; bottom: 32px; width: 56px; height: 56px; }
.grid > .tile:first-child .tile-go .ico { width: 24px; height: 24px; }
/* 상품 수별 배치(서버가 클래스를 붙인다): 1·2·3·4개, 5개 이상은 3칸 행을 채우고 남는 1~2개를 넓힌다 */
.grid--1 { grid-template-columns: 1fr; grid-auto-rows: 440px; }
.grid--2 { grid-template-columns: 3fr 2fr; grid-auto-rows: 440px; }
.grid--1 > .tile:first-child, .grid--2 > .tile:first-child { grid-row: auto; }
.grid--2 > .tile:nth-child(2) .tile-name, .grid--3 > .tile:not(:first-child) .tile-name { font-size: 30px; }
.grid--2 > .tile:nth-child(2) .tile-price, .grid--3 > .tile:not(:first-child) .tile-price { font-size: 26px; }
.grid--3 { grid-template-columns: 3fr 2fr; }
.grid--4 > .tile:last-child, .grid--t2 > .tile:last-child { grid-column: span 2; }
.grid--t1 > .tile:last-child { grid-column: 1 / -1; }

.empty { padding: 120px 0 40px; text-align: center; color: var(--on-paper-soft); font-size: 18px; font-weight: 700; }
.empty svg { display: block; width: 72px; height: auto; margin: 0 auto 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .6; }

/* 하단 */
.ft { background: var(--ink); color: var(--on-ink); padding: 72px 0 48px; }
.ft-more { display: inline-flex; align-items: center; min-height: 56px; margin-bottom: 48px; font-size: 44px; font-weight: 900; letter-spacing: -.05em; line-height: 1.15; }
.ft-more span { border-bottom: 4px solid var(--brand); }
.ft-row { display: flex; align-items: center; gap: 24px; padding-top: 16px; border-top: 1px solid var(--line-ink); font-size: 14px; color: var(--on-ink-soft); }
.ft-links { display: flex; gap: 24px; }
.ft-links a { display: inline-flex; align-items: center; min-height: 44px; }
.ft-note { margin-left: auto; }
.ft-row strong { color: var(--on-ink); font-weight: 800; }

/* ───────── 모바일 ───────── */
@media (max-width: 860px) {
  :root { --gut: 20px; }
  .hero { min-height: 500px; }
  .hd { height: 64px; gap: 10px; }
  .hd-home svg { width: 26px; height: 29px; }
  .hd-name { font-size: 15px; }
  .hd-home + .hd-name { padding-left: 10px; }
  .hd-logo { height: 44px; padding: 0 10px; }
  .hd-pay { height: 44px; padding: 0 14px; font-size: 14px; }
  .hero-txt { padding-top: 120px; padding-bottom: 28px; }
  .hero-count { font-size: 14px; }
  .hero h1 { margin-top: 12px; line-height: 1.08; }
  .hero-mark { width: 78%; right: -14%; top: 16%; }

  .intro { padding-top: 32px; }
  .market-body { font-size: 16px; line-height: 1.7; }

  .tabs { margin-top: 28px; }
  .tabs ul { height: 60px; }
  .tabs a { padding: 0 16px; font-size: 15px; }
  .tabs .wrap { padding-right: 0; }
  .tabs li:last-child { padding-right: var(--gut); }

  main.wrap { padding-bottom: 0; }
  .cat { padding-top: 44px; scroll-margin-top: 60px; }
  .tabs + main > .cat:first-child { padding-top: 32px; }
  .cat-hd { margin-bottom: 16px; }
  .cat-hd h2 { font-size: 38px; }
  .cat-hd span { font-size: 16px; }
  /* 화면 폭을 꽉 채운 큰 타일 */
  .grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 3px; margin: 0 calc(var(--gut) * -1); }
  .grid > .tile, .grid > .tile:first-child, .grid > .tile:last-child { grid-row: auto; grid-column: auto; aspect-ratio: 4 / 3; }
  .grid > .tile .tile-txt, .grid > .tile:first-child .tile-txt { padding: 20px 80px 20px 20px; }
  .grid > .tile .tile-name, .grid > .tile:first-child .tile-name { font-size: 26px; line-height: 1.18; letter-spacing: -.045em; }
  .grid > .tile .tile-price, .grid > .tile:first-child .tile-price { margin-top: 4px; font-size: 22px; }
  .grid > .tile .tile-go, .grid > .tile:first-child .tile-go { right: 18px; bottom: 20px; width: 48px; height: 48px; }
  .grid > .tile .tile-go .ico { width: 22px; height: 22px; }
  .empty { padding: 72px 0; }

  .ft { padding: 56px 0 32px; }
  .ft-more { margin-bottom: 36px; font-size: 24px; }
  .ft-more span { border-bottom-width: 3px; }
  .ft-row { display: block; font-size: 13px; }
  .ft-links { gap: 20px; }
  .ft-note { margin: 4px 0; }
}

/*
 * ───────── 상품 상세·구매 화면(/m/{마켓코드}/{상품id}) — .pd-* ─────────
 * 이 화면은 Tailwind CDN 을 같이 쓴다(스크립트가 hidden·opacity-50 등을 붙였다 뗀다).
 * Tailwind 의 기본 초기화(버튼 배경 투명 등)가 이 파일보다 뒤에 들어오므로, 여기 규칙은
 * 전부 body.pd-page 아래로 걸어 우선순위를 한 단계 높인다. 첫 화면에는 .pd-page 가 없어 영향이 없다.
 */
.pd-page { line-height: 1.6; }
.pd-page .hidden, .pd-page [hidden] { display: none !important; }
.pd-page .pd-bar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; }
.pd-page .pd-bar :focus-visible { outline-color: #fff; }
.pd-page .pd-bar .hd { height: 64px; }
.pd-page .pd-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.pd-page .pd-back span { overflow: hidden; text-overflow: ellipsis; }
.pd-page a.hd-logo { height: 44px; }

/* PC: 왼쪽 사진·이름·본문 + 오른쪽에 붙어 따라오는 구매 패널 */
.pd-page .pd { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) min(440px, 40vw); gap: clamp(32px, 4.4vw, 64px); align-items: start; padding-top: 48px; padding-bottom: 96px; }
.pd-page .pd--seat { grid-template-columns: minmax(0, 1fr) min(560px, 46vw); gap: clamp(32px, 3.4vw, 48px); }
.pd-page .pd-main { display: flex; flex-direction: column; min-width: 0; }
.pd-page .pd-head { order: -2; margin-bottom: 32px; }
.pd-page .pd-head h1 { font-size: clamp(40px, 4.6vw, 68px); font-weight: 900; line-height: 1.08; letter-spacing: -.05em; text-wrap: balance; }
.pd-page .pd-price { margin-top: 14px; font-size: 34px; font-weight: 900; line-height: 1.2; letter-spacing: -.02em; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.pd-page .pd-price small { font-size: .62em; font-weight: 800; margin-left: 2px; }
.pd-page .pd-photo { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--brand); }
.pd-page .pd-photo img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* 이미지 없는 상품 — 첫 화면 타일과 같은 테마 색 바탕 + 티켓 모양 */
.pd-page .pd-photo--noimg { aspect-ratio: 16 / 7; }
.pd-page .pd-photo--noimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12, 27, 36, .72) 0, rgba(12, 27, 36, .3) 50%, rgba(12, 27, 36, .14) 100%); }
.pd-page .pd-ticket { position: absolute; z-index: 1; left: 50%; top: 50%; width: min(34%, 260px); color: #fff; opacity: .6; transform: translate(-50%, -50%) rotate(-8deg); }
.pd-page .pd-ticket svg { display: block; width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.pd-page .pd-body { margin-top: 40px; }
/* 통합상품 환불 제한은 긴 본문 아래로 밀리지 않게 이름 바로 아래에 둔다 */
.pd-page .pd-warn { order: -1; margin: -8px 0 28px; padding: 14px 16px; border-left: 4px solid #b45309; background: #fbefd5; color: #6b3f04; font-size: 14px; font-weight: 600; line-height: 1.55; }

.pd-page .pd-buy { position: sticky; top: 88px; display: flex; flex-direction: column; max-height: calc(100vh - 136px); background: #fff; border: 1.5px solid var(--ink); scroll-margin-top: 88px; }
.pd-page .pd-steps { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 24px 8px; }
.pd-page .pd-step { padding: 22px 0; border-bottom: 1px solid var(--line-paper); }
.pd-page .pd-steps > :last-child { border-bottom: 0; }
.pd-page .pd-step-h { display: block; margin-bottom: 12px; font-size: 17px; font-weight: 800; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); }
.pd-page .pd-req { color: #c2410c; }
.pd-page .pd-hint { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--on-paper-soft); }
.pd-page .pd-step-h + .pd-hint { margin-top: -6px; }

/* 이용일(회차) */
.pd-page .pd-opts { display: grid; gap: 8px; margin-top: 12px; }
.pd-page .pd-opt { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border: 1.5px solid var(--line-paper); border-radius: 10px; background: #fff; cursor: pointer; }
.pd-page .pd-opt:has(:checked) { border-color: var(--brand-deep); box-shadow: inset 0 0 0 1px var(--brand-deep); background: color-mix(in srgb, var(--brand) 9%, #fff); }
.pd-page .pd-opt input, .pd-page .pd-agree input { flex: none; width: 22px; height: 22px; accent-color: var(--brand-deep); }
.pd-page .pd-opt-txt { flex: 1; min-width: 0; }
.pd-page .pd-opt-date { display: block; font-size: 16px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pd-page .pd-opt-time { margin-left: 4px; font-weight: 600; color: var(--on-paper-soft); }
.pd-page .pd-opt-code { display: block; font-size: 13px; line-height: 1.4; color: var(--on-paper-soft); }
.pd-page .pd-left { flex: none; font-size: 13px; color: var(--on-paper-soft); font-variant-numeric: tabular-nums; }
.pd-page .pd-left--low { color: #b91c1c; font-weight: 800; }

/* 좌석 — 맵 안쪽은 seat-map.js 가 그린다. 여기는 바깥 틀만 */
.pd-page .pd-grades { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--on-paper-soft); }
.pd-page .pd-grade { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 700; }
.pd-page .pd-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.pd-page .pd-stage { margin: 14px 0 8px; padding: 5px 0; background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 800; text-align: center; letter-spacing: .4em; text-indent: .4em; }

/* 수량·번호 입력 */
.pd-page .pd-qty, .pd-page .pd-row { display: flex; gap: 8px; }
.pd-page .pd-qty button { flex: none; width: 48px; height: 48px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-size: 22px; font-weight: 800; line-height: 1; }
.pd-page .pd-qty input { flex: 1; min-width: 0; height: 48px; border: 1.5px solid var(--line-paper); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 20px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.pd-page .pd-input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid rgba(12, 27, 36, .42); border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; font-weight: 600; }
.pd-page .pd-input::placeholder { color: #7b878e; font-weight: 500; }
.pd-page .pd-input:focus { border-color: var(--brand-deep); }
.pd-page .pd-input:disabled { background: var(--paper); color: var(--on-paper-soft); }
.pd-page .pd-input--code { letter-spacing: .18em; }
.pd-page .pd-btn { flex: none; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 800; white-space: nowrap; }
.pd-page .pd-btn--ink { background: var(--ink); color: #fff; }
.pd-page .pd-btn--s { min-height: 44px; margin-top: 8px; font-size: 14px; }
.pd-page .pd-btn:disabled { cursor: not-allowed; }
.pd-page #otpMsg { margin-top: 8px; font-size: 13px; line-height: 1.5; }
.pd-page #otpMsg.text-gray-400, .pd-page #otpMsg.text-gray-500 { color: var(--on-paper-soft); }

/* 결제 모듈(토스 위젯이 안쪽을 그린다) */
.pd-page .pd-widget { margin-top: 16px; overflow: hidden; background: #fff; }
.pd-page .pd-widget--pay { min-height: 100px; }
.pd-page .pd-alert { margin-top: 8px; font-size: 14px; font-weight: 700; line-height: 1.5; color: #b91c1c; }
.pd-page .pd-alert:empty { margin: 0; }

/* 구매 전 확인·판매자 고지·동의 */
.pd-page .pd-note-list { display: grid; gap: 4px; padding-left: 1.2em; list-style: disc; font-size: 13px; line-height: 1.6; color: var(--on-paper-soft); }
.pd-page .pd-note-list b { color: var(--ink); font-weight: 800; }
.pd-page .pd-terms { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 8px; font-size: 13px; }
.pd-page .pd-terms a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.pd-page .pd-seller { margin-top: 8px; border-top: 1px solid var(--line-paper); font-size: 13px; }
.pd-page .pd-seller summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.pd-page .pd-seller dl { display: grid; gap: 4px; padding-bottom: 12px; color: var(--ink); }
.pd-page .pd-seller dl div { display: flex; gap: 8px; }
.pd-page .pd-seller dt { flex: none; width: 7.5em; color: var(--on-paper-soft); }
/* 중개 고지(V179) — 판매자가 기관일 때만 나온다 */
.pd-page .pd-agency-notice { margin: 4px 0 8px; font-size: 12px; line-height: 1.5; color: var(--on-paper-soft); }
.pd-page .pd-agree { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 700; line-height: 1.45; cursor: pointer; }
.pd-page .pd-agree:has(:checked) { border-color: var(--brand-deep); box-shadow: inset 0 0 0 1px var(--brand-deep); background: color-mix(in srgb, var(--brand) 9%, #fff); }

/* 결제 버튼 — 잠긴 동안에도 금액 글자는 읽히게 흐리게 하지 않고 색을 바꾼다 */
.pd-page .pd-paybar { flex: none; padding: 16px 24px 20px; border-top: 1.5px solid var(--ink); background: #fff; }
.pd-page .pd-pay { display: block; width: 100%; min-height: 58px; padding: 8px 20px; border-radius: 999px; background: var(--brand-deep); color: #fff; font-size: 18px; font-weight: 900; line-height: 1.25; letter-spacing: -.02em; }
.pd-page .pd-pay--test { background: #b45309; }
.pd-page .pd-pay:disabled { opacity: 1; background: #dcd6cb; color: #4a5a63; cursor: not-allowed; }

.pd-page .pd-ft { padding: 28px 0; }
.pd-page .pd-ft .ft-row { padding-top: 0; border-top: 0; }

/*
 * 모바일·태블릿: 한 줄로 쌓고 결제 버튼만 화면 바닥에 붙인다.
 * 보이는 순서는 사진 → 이름·가격 → (통합상품 안내) → 구매 단계 → 본문. 본문이 길어도 구매 단계가 멀어지지 않는다.
 * 🔴 HTML 순서는 그대로다(이름 → 본문 → 구매 단계) — .pd-main 을 풀어(display: contents) order 로만 옮긴다.
 *    결제 스크립트가 기대는 구조를 건드리지 않기 위해서다. 그래서 본문 안에 링크가 있으면 Tab 은 본문 링크를 먼저 지난다.
 */
@media (max-width: 1023px) {
  .pd-page .pd, .pd-page .pd--seat { display: flex; flex-direction: column; align-items: stretch; gap: 0; max-width: 720px; padding-top: 0; padding-bottom: 24px; }
  .pd-page .pd-main { display: contents; }
  .pd-page .pd-photo { order: -3; }
  .pd-page .pd-head { margin: 22px 0 0; }
  .pd-page .pd-warn { margin: 16px 0 0; }
  .pd-page .pd-head h1 { font-size: clamp(30px, 9vw, 48px); line-height: 1.12; }
  .pd-page .pd-price { margin-top: 8px; font-size: 26px; }
  .pd-page .pd-photo { margin: 0 calc(var(--gut) * -1); aspect-ratio: 4 / 3; }
  .pd-page .pd-photo--noimg { aspect-ratio: 16 / 9; }
  .pd-page .pd-ticket { width: 44%; }
  .pd-page .pd-body { order: 1; margin-top: 12px; padding-top: 28px; border-top: 1.5px solid var(--ink); }
  .pd-page .pd-buy { position: static; max-height: none; margin-top: 28px; border: 0; border-top: 1.5px solid var(--ink); background: none; scroll-margin-top: 64px; }
  .pd-page .pd-steps { overflow: visible; padding: 0; }
  .pd-page .pd-paybar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-paper); background: var(--paper); }
  .pd-page .pd-pay { min-height: 56px; font-size: 17px; }
  .pd-page .pd-ft { padding: 24px 0 calc(100px + env(safe-area-inset-bottom, 0px)); }
}

/*
 * ───────── 결과 화면(결제 완료·실패, 마켓 닫힘) — body.mk-result ─────────
 * 이 화면들에는 마켓 테마 색이 오지 않는다. --brand 를 잉크색으로 두어 주 버튼(--brand-deep)이 잉크색이 된다.
 */
body.mk-result { --brand: var(--ink); align-items: center; justify-content: center; padding: 56px var(--gut); }
@supports (min-height: 100svh) { body.mk-result { min-height: 100svh; } }
/* 결제 완료 화면의 상단 한 줄 — 상품 상세의 .pd-bar 와 같은 높이·색 */
.mk-result .rs-top { position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; height: 64px; background: var(--ink); color: #fff; }
.mk-result .rs-top a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; font-weight: 800; }
.mk-result .rs-top :focus-visible { outline-color: #fff; }
body.mk-result:has(.rs-top) { padding-top: 112px; }
.mk-result .rs { width: 100%; max-width: 480px; text-align: center; }
.mk-result .rs-ico { display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 28px; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); }
.mk-result .rs-ico svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mk-result .rs-ico--ok { background: var(--ink); color: var(--paper); }
.mk-result .rs-ico--fail { border-color: #b91c1c; color: #b91c1c; }
.mk-result .rs-ico--closed { border-color: var(--on-paper-soft); color: var(--on-paper-soft); }
.mk-result .rs h1 { font-size: clamp(34px, 9vw, 52px); font-weight: 900; line-height: 1.12; letter-spacing: -.05em; text-wrap: balance; }
.mk-result .rs-lead { margin-top: 16px; font-size: 17px; line-height: 1.6; color: var(--on-paper-soft); }
.mk-result .rs-lead b { color: var(--ink); font-weight: 800; }
.mk-result .rs-sub { margin-top: 4px; font-size: 14px; color: var(--on-paper-soft); }
.mk-result .rs-box { margin-top: 28px; padding: 16px 20px; border: 1.5px solid var(--ink); background: #fff; text-align: left; }
.mk-result .rs-box-k { font-size: 13px; font-weight: 700; color: var(--on-paper-soft); }
.mk-result .rs-box-v { margin-top: 2px; font-size: 18px; font-weight: 800; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.mk-result .rs-name { margin-top: 24px; font-size: 16px; font-weight: 800; }
.mk-result .rs-admin { margin-top: 12px; font-size: 12px; line-height: 1.6; color: var(--on-paper-soft); }
.mk-result .rs-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 32px; padding: 8px 24px; border: 0; border-radius: 999px; background: var(--brand-deep); color: #fff; font: inherit; font-size: 17px; font-weight: 900; letter-spacing: -.02em; cursor: pointer; }
.mk-result .rs-btn--line { display: inline-flex; width: auto; min-height: 48px; padding: 8px 28px; border: 1.5px solid var(--ink); background: none; color: var(--ink); font-size: 15px; font-weight: 800; }

/*
 * ───────── 지갑(/wallet/{기관id}) — body.wl-page ─────────
 * Figma "티켓 및 티켓 지갑 디자인" v2: 겹친 카드 묶음 + 지난 티켓 한 줄 + 지갑 꾸미기 + 아래에서 올라오는 판.
 * 휴대폰에서 쓰는 화면이라 PC 도 가운데 한 칼럼이다.
 * 바탕색 테마는 <html data-wl-theme="teal|lavender|sand"> (없으면 Ink) — wallet.js 가 이 브라우저에만 저장한다.
 * 화면의 스크립트가 클래스 hidden·wallet-modal__quote·muted 를 붙였다 뗀다 — 이름을 바꾸지 않는다.
 */
body.wl-page { --wl-bg: #eef0f4; --wl-accent: #0c1b24; --wl-chip: #dfe3ea; --brand: var(--wl-accent); --brand-deep: var(--wl-accent); background: var(--wl-bg); }
[data-wl-theme="teal"] body.wl-page { --wl-bg: #eef8f4; --wl-accent: #0e6b5e; --wl-chip: #d9eee8; }
[data-wl-theme="lavender"] body.wl-page { --wl-bg: #f4f1fb; --wl-accent: #5b4f8c; --wl-chip: #e4def4; }
[data-wl-theme="sand"] body.wl-page { --wl-bg: #faf4ea; --wl-accent: #765528; --wl-chip: #eee3cf; }
.wl-page .hidden { display: none !important; }
.wl-page [hidden] { display: none !important; }
.wl-page .wl-col { width: 100%; max-width: 500px; margin: 0 auto; padding: 0 20px; }
.wl-page .wl-top { padding: 28px 0 0; }
.wl-page .wl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wl-page .wl-head > div { min-width: 0; }
.wl-page .wl-eyebrow { font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--wl-accent); }
.wl-page .wallet-title { margin-top: 6px; font-size: 27px; font-weight: 700; line-height: 1.25; letter-spacing: -.03em; color: var(--wl-accent); }
.wl-page .wl-deco-btn { flex: none; min-height: 44px; margin-top: 8px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--wl-chip); color: var(--wl-accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.wl-page .wl-lead { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--on-paper-soft); text-wrap: pretty; }
.wl-page main.wl-col { flex: 1; padding-top: 24px; padding-bottom: 72px; }
.wl-page .muted { font-size: 14px; line-height: 1.6; color: var(--on-paper-soft); }
.wl-page main h2 { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -.03em; }

/* 번호 인증 — 흰 카드 하나에 제목·안내·입력·버튼을 세로로 */
.wl-page .panel { padding: 32px 24px 28px; border-radius: 26px; background: #fff; box-shadow: 0 12px 32px rgba(12, 27, 36, .08); }
.wl-page .panel + .panel { margin-top: 12px; }
.wl-page .panel--none { padding: 24px; background: none; box-shadow: inset 0 0 0 1.5px var(--line-paper); }
.wl-page .panel[aria-labelledby="add-title"]::before { content: ""; display: block; width: 56px; height: 40px; margin: 0 auto 20px; border-radius: 12px; background: linear-gradient(var(--wl-accent), var(--wl-accent)) 14px 14px / 28px 3px no-repeat, linear-gradient(var(--wl-accent), var(--wl-accent)) 14px 23px / 18px 3px no-repeat, var(--wl-chip); }
.wl-page .panel[aria-labelledby="add-title"] > h2 { font-size: 24px; text-align: center; }
.wl-page .panel[aria-labelledby="add-title"] > h2 + .muted { text-align: center; text-wrap: balance; }
.wl-page .panel h2 + .muted { margin-top: 8px; }
.wl-page label, .wl-page legend { display: block; margin: 22px 0 8px; font-size: 14px; font-weight: 700; }
.wl-page legend { margin-top: 0; padding: 0; }
.wl-page input:not([type="radio"]) { width: 100%; min-width: 0; height: 54px; padding: 0 14px; border: 1.5px solid rgba(12, 27, 36, .42); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wl-page input::placeholder { color: #6b777e; font-weight: 500; }
.wl-page input:not([type="radio"]):focus { border-color: var(--wl-accent); }
.wl-page .field-action { display: grid; gap: 12px; }
/*
 * 인증번호 6칸 — 입력 요소는 하나(#otp)이고, 칸은 바탕 그림이다. 숫자 폭이 같은 글꼴(tabular-nums)에서
 * 글자 간격을 칸 너비(46px)에 맞춘다. 자동 채움(one-time-code)·붙여넣기가 그대로 된다.
 */
/* 입력 칸은 마지막 글자 뒤 간격만큼 6칸 그림보다 넓다. 감싼 틀이 그 남는 폭을 잘라 6칸을 가운데에 놓는다 */
.wl-page .otp-wrap { justify-self: center; display: block; width: 276px; max-width: 100%; overflow: hidden; overflow: clip; border-radius: 12px; }  /* clip: 커서가 끝에 가도 안쪽이 밀리지 않는다 */
.wl-page .otp-wrap:focus-within { outline: 3px solid var(--wl-accent); outline-offset: 3px; }
.wl-page #otp:focus { outline: none; }
.wl-page #otp { box-sizing: content-box; width: 278px; max-width: 100%; height: 54px; padding: 0 0 0 calc((38px - 1ch) / 2); border: 0; border-radius: 12px; font-size: 24px; font-weight: 700; letter-spacing: calc(46px - 1ch);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='276' height='54' fill='%23fff' stroke='%230c1b24' stroke-opacity='.42' stroke-width='1.5'%3E%3Crect x='.75' y='.75' width='36.5' height='52.5' rx='11'/%3E%3Crect x='46.75' y='.75' width='36.5' height='52.5' rx='11'/%3E%3Crect x='92.75' y='.75' width='36.5' height='52.5' rx='11'/%3E%3Crect x='138.75' y='.75' width='36.5' height='52.5' rx='11'/%3E%3Crect x='184.75' y='.75' width='36.5' height='52.5' rx='11'/%3E%3Crect x='230.75' y='.75' width='36.5' height='52.5' rx='11'/%3E%3C/svg%3E") 0 0 / 276px 54px no-repeat; }
/* 아주 좁은 화면(6칸이 안 들어감)에서는 보통 입력 칸으로 */
@media (max-width: 359px) {
  .wl-page .otp-wrap { width: 100%; overflow: visible; }
  .wl-page #otp { box-sizing: border-box; width: 100%; padding: 0 14px; border: 1.5px solid rgba(12, 27, 36, .42); border-radius: 12px; background: #fff; letter-spacing: .3em; }
}
/* 인증번호 남은 시간(알약)·만료 안내·번호 수정 — wallet.js 가 띄운다 */
.wl-page .wl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wl-page .wl-otp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 8px; }
.wl-page .wl-otp-head label { margin: 0; }
.wl-page .wl-otp-timer { flex: none; min-width: 72px; padding: 4px 14px; border-radius: 999px; background: var(--wl-chip); color: var(--wl-accent); font-size: 15px; font-weight: 700; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; }
.wl-page .wl-otp-timer.is-expired { background: #fde8e8; color: #b91c1c; }
.wl-page .wl-otp-expired { display: grid; }
.wl-page .wl-otp-expired-msg { margin-bottom: 12px; font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.wl-page .wl-otp-expired-msg:empty { margin: 0; }
.wl-page .wl-otp-edit { margin-top: 8px; font-size: 14px; color: var(--on-paper-soft); text-align: center; }
.wl-page .wl-otp-edit button { min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--wl-accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wl-page .primary { min-height: 54px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--wl-accent); color: #fff; font: inherit; font-size: 16px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.wl-page .primary:disabled { background: #d9dce1; color: #4a5a63; cursor: not-allowed; }
.wl-page #message, .wl-page #refundMsg { margin-top: 14px; font-weight: 700; color: var(--ink); }
.wl-page #message:empty, .wl-page #refundMsg:empty { margin: 0; }

/*
 * 겹친 카드 묶음 — 고른 카드 한 장만 펼치고(.is-open) 나머지는 머리만 보인다. 펼친 카드는 묶음 맨 앞(아래)으로 온다.
 * 접기는 wallet.js 가 .is-js 를 붙였을 때만 — 스크립트가 없으면 전부 펼친 채로 보인다.
 * 카드 색(data-tone)은 행사 티켓 고유 색이라 바탕색 테마를 따르지 않는다. 흰 글자 대비 4.5:1 이상인 색만 쓴다.
 */
.wl-page .panel + .wl-sec, .wl-page .wl-sec + .wl-sec { margin-top: 36px; }
.wl-page .wl-none { margin-top: 10px; font-size: 15px; }
.wl-page .wallet-stack { display: grid; gap: 12px; margin-top: 18px; }
.wl-page .wallet-card { --c1: #06413b; --c2: #0c766b; position: relative; isolation: isolate; overflow: hidden; border-radius: 26px; background: linear-gradient(120deg, var(--c1), var(--c2)); color: #fff; box-shadow: 0 10px 22px rgba(12, 27, 36, .2); }
.wl-page .wallet-card[data-tone="1"] { --c1: #8f2327; --c2: #a63034; }
.wl-page .wallet-card[data-tone="2"] { --c1: #2a2369; --c2: #6049a9; }
.wl-page .wallet-card[data-tone="3"] { --c1: #10304d; --c2: #1f5f8b; }
.wl-page .wallet-card[data-tone="4"] { --c1: #4a1942; --c2: #8a2f6b; }
.wl-page .wallet-card[data-tone="5"] { --c1: #57320f; --c2: #8f541a; }
.wl-page .wallet-card :focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.wl-page .wl-card-h { font-size: inherit; }
.wl-page .wl-card-toggle { display: block; width: 100%; min-height: 64px; padding: 11px 22px 10px; border: 0; border-radius: 26px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wl-page .wl-card-org { display: block; font-size: 12px; font-weight: 700; line-height: 1.5; }
.wl-page .wl-card-name { display: block; overflow: hidden; font-size: 16px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.wl-page .wallet-card.is-open .wl-card-toggle, .wl-page .wallet-stack:not(.is-js) .wl-card-toggle { padding: 22px 22px 0; cursor: default; }
.wl-page .wallet-stack.is-js .wallet-card.is-open .wl-card-toggle { cursor: pointer; }
.wl-page .wallet-card.is-open .wl-card-org, .wl-page .wallet-stack:not(.is-js) .wl-card-org { overflow: hidden; padding-right: 104px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.wl-page .wallet-card.is-open .wl-card-name, .wl-page .wallet-stack:not(.is-js) .wl-card-name { margin-top: 18px; font-size: 21px; line-height: 1.3; white-space: normal; }
.wl-page .wallet-stack.is-js .wallet-card:not(.is-open) .wl-card-body { display: none; }
/* 많을 때(6장 이상)는 접힌 카드를 낮추고 간격을 줄여 묶음이 길어지지 않게 한다 */
.wl-page .wallet-stack.is-js[data-many] { gap: 5px; }
.wl-page .wallet-stack.is-js[data-many] .wallet-card:not(.is-open) { border-radius: 16px; box-shadow: none; }
.wl-page .wallet-stack.is-js[data-many] .wallet-card:not(.is-open) .wl-card-toggle { min-height: 46px; padding: 0 20px; border-radius: 16px; }
.wl-page .wallet-stack.is-js[data-many] .wallet-card:not(.is-open) .wl-card-org { display: none; }
.wl-page .wallet-stack.is-js[data-many] .wallet-card.is-open { margin-top: 7px; }
.wl-page .wl-card-body { padding: 10px 22px 22px; }
.wl-page .wallet-card.is-open::after, .wl-page .wallet-stack:not(.is-js) .wallet-card::after { content: ""; position: absolute; right: -60px; bottom: -70px; z-index: -1; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .09); pointer-events: none; }
/* 상태 알약은 펼친 카드의 오른쪽 위(기관 이름 옆) */
.wl-page .wl-card-top { position: absolute; top: 19px; right: 20px; pointer-events: none; }
.wl-page .wallet-card .status { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; }
.wl-page .wallet-card .status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #15803d; }
.wl-page .wallet-card .status--soon { background: rgba(0, 0, 0, .26); color: #fff; }
.wl-page .wallet-card .status--soon::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.wl-page .wallet-card .status--part::before { background: #b45309; }
.wl-page .wallet-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wl-page .wl-card-kind { font-size: 14px; font-weight: 600; }
.wl-page .wallet-card .card-meta { margin-top: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.wl-page .wl-card-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; }
.wl-page .card-expiry { font-size: 13px; font-variant-numeric: tabular-nums; }
.wl-page .wallet-card__footer { display: flex; gap: 8px; margin-top: 18px; }
.wl-page .wallet-card__link { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; background: rgba(0, 0, 0, .26); color: #fff; font-size: 15px; font-weight: 700; }
.wl-page .wallet-card__refund { min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* 지난 티켓 — 한 줄(누르면 전달·취소·사용 내역이 펼쳐진다) */
.wl-page .wl-past-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; margin-top: 14px; padding: 0 16px; border: 0; border-radius: 16px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; }
.wl-page .wl-past-count { margin-left: auto; font-weight: 700; color: var(--on-paper-soft); font-variant-numeric: tabular-nums; }
.wl-page .wl-past-toggle::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid var(--on-paper-soft); border-bottom: 1.5px solid var(--on-paper-soft); transform: rotate(-45deg); }
.wl-page .wl-past-toggle[aria-expanded="true"]::after { transform: rotate(45deg); }
.wl-page .wl-past { margin-top: 8px; padding: 0 16px; border-radius: 16px; background: #fff; }
.wl-page .wallet-group + .wallet-group { border-top: 1px solid var(--line-paper); }
.wl-page .wallet-group > summary { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 0; list-style: none; font-size: 15px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.wl-page .wallet-group > summary::-webkit-details-marker { display: none; }
.wl-page .wallet-group > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 3px auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.wl-page .wallet-group[open] > summary::after { margin-bottom: -3px; transform: rotate(-135deg); }
.wl-page .wallet-group__count { font-weight: 700; color: var(--on-paper-soft); font-variant-numeric: tabular-nums; }
.wl-page .wallet-group--empty > summary { color: var(--on-paper-soft); }
.wl-page .wallet-group__body { padding: 0 0 18px; }
.wl-page .wallet-group__body .wl-none { margin-top: 0; font-size: 14px; }
.wl-page .wallet-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-paper); }
.wl-page .wallet-group__body > .wallet-row:first-child { padding-top: 2px; border-top: 0; }
.wl-page .wallet-group__body > .wallet-row:last-child { padding-bottom: 0; }
.wl-page .wallet-row > div:first-child { min-width: 0; }
.wl-page .wallet-row h3 { font-size: 16px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.wl-page .wallet-row p { margin-top: 5px; font-size: 13px; line-height: 1.6; color: var(--on-paper-soft); font-variant-numeric: tabular-nums; }
.wl-page .wallet-row p strong { color: var(--ink); font-weight: 700; }
.wl-page .wallet-row__state { display: inline-block; margin-right: 2px; padding: 0 9px; border-radius: 999px; background: var(--wl-bg); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.8; }
.wl-page .wallet-row a { flex: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.wl-page .wallet-row__actions { flex: none; display: flex; align-items: center; gap: 14px; }
.wl-page .wallet-row__refund { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: none; box-shadow: inset 0 0 0 1.5px rgba(12, 27, 36, .42); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* 아래에서 올라오는 판 — 취소(환불)·지갑 꾸미기. PC 에서는 가운데 */
.wl-page .wallet-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(12, 27, 36, .55); animation: wl-fade .2s ease-out; }
.wl-page .wallet-modal__box { position: relative; width: 100%; max-width: 500px; max-height: 92%; overflow-y: auto; padding: 34px 24px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: 26px 26px 0 0; background: #fff; animation: wl-rise .26s cubic-bezier(.2, .8, .2, 1); }
.wl-page .wallet-modal__box::before { content: ""; position: absolute; left: 50%; top: 12px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: #c9d0d6; }
.wl-page .wallet-modal__box h3 { font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -.03em; }
.wl-page .wallet-modal__box h3 + .muted { margin-top: 2px; }
.wl-page #refundProduct { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: #f1f3f6; font-size: 16px; font-weight: 700; color: var(--ink); }
.wl-page #refundProduct:empty { display: none; }
.wl-page #refundPhone + .muted { margin-top: 8px; }
.wl-page .wallet-modal__quote { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: #f1f3f6; }
.wl-page .wallet-modal__quote p { font-size: 15px; font-weight: 600; line-height: 1.5; }
.wl-page .wallet-modal__quote p strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wl-page .wallet-modal__quote p.muted { margin-top: 4px; font-size: 14px; font-weight: 500; }
.wl-page .wallet-modal__actions { display: flex; gap: 12px; margin-top: 26px; }
.wl-page .wallet-modal__actions button { flex: 1; min-height: 54px; padding: 0 12px; border: 0; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(12, 27, 36, .3); color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.wl-page .wallet-modal__actions .primary { background: var(--wl-accent); box-shadow: none; color: #fff; }
.wl-page .wallet-modal__actions button:disabled { background: #d9dce1; box-shadow: none; color: #4a5a63; cursor: not-allowed; }
@keyframes wl-fade { from { opacity: 0; } }
@keyframes wl-rise { from { transform: translateY(40px); opacity: 0; } }

/* 지갑 꾸미기 — 배경색 4종(라디오) */
.wl-page .wl-swatches { margin-top: 22px; border: 0; }
.wl-page .wl-swatch-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wl-page .wl-swatch { position: relative; margin: 0; font-size: 12px; font-weight: 500; color: var(--on-paper-soft); cursor: pointer; }
.wl-page .wl-swatch input { position: absolute; opacity: 0; width: 100%; height: 56px; margin: 0; cursor: pointer; }
.wl-page .wl-swatch span { display: flex; align-items: center; justify-content: center; height: 56px; margin-bottom: 6px; border-radius: 16px; background: var(--sw); color: #fff; font-size: 22px; }
.wl-page .wl-swatch input:checked + span::before { content: "✓"; }
.wl-page .wl-swatch input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.wl-page .wl-swatches + .muted { margin-top: 16px; }

@media (min-width: 720px) {
  .wl-page .wl-top { padding-top: 56px; }
  .wl-page .wallet-modal { align-items: center; padding: 20px; }
  .wl-page .wallet-modal__box { max-width: 440px; padding-top: 28px; border-radius: 26px; }
  .wl-page .wallet-modal__box::before { display: none; }
}
@media (max-width: 600px) {
  /* 버튼 둘(내역 보기·취소)이 붙는 행은 글 아래로 내린다 */
  .wl-page .wallet-row:has(.wallet-row__actions) { display: block; }
  .wl-page .wallet-row__actions { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .wl-page .wallet-modal, .wl-page .wallet-modal__box { animation: none; }
}
