:root {
  --ink: #0E1A24;
  --paper: #F4F7F8;
  --surface: #FFFFFF;
  --primary: #0E7C86;
  --primary-dark: #0A5A62;
  --primary-soft: #E3F2F2;
  --accent: #E0703A;
  --accent-soft: #FBEDE5;
  --muted: #6B7B85;
  --line: #E2E9EB;
  --naver: #03C75A;
  --kakao: #FEE500;
  --ok: #16A34A;
  --ok-soft: #E7F6EC;
  --warn: #D97706;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

/* ── Pretendard 로딩 시 텍스트 폭 변화로 topbar 메뉴가 흔들리는 것 방지 ──
   CDN pretendard.css는 font-display: swap이라 폰트가 늦게 도착하면
   레이아웃이 한번 더 밀린다. 같은 family/weight로 재선언해 optional로
   덮어써서, 폰트가 늦으면 그냥 폴백 글꼴로 고정되고 나중에 흔들리지 않게 한다. */
@font-face {
  font-family: 'Pretendard';
  font-weight: 400;
  font-display: optional;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/static/woff2/Pretendard-Regular.woff2) format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 600;
  font-display: optional;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/static/woff2/Pretendard-SemiBold.woff2) format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 700;
  font-display: optional;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/static/woff2/Pretendard-Bold.woff2) format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 800;
  font-display: optional;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/static/woff2/Pretendard-ExtraBold.woff2) format('woff2');
}

* { box-sizing: border-box; }
/* 세로 스크롤바가 로딩 중 생겼다 없어졌다 하면서 뷰포트 폭이 바뀌어
   topbar(.left:0;right:0 고정)가 옆으로 튀는 것 방지 — 스크롤바 자리를 항상 고정폭으로 예약 */
html { scrollbar-gutter: stable; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); padding-top: 60px; }
a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; }

/* ── 버튼 ── */
.btn {
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: filter .15s;
  display: inline-block;
  text-align: center;
}
.btn:hover { filter: brightness(0.95); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-full { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ── 로고 ── */
.logo { display: flex; align-items: center; gap: 8px; }
.logo span { font-weight: 800; letter-spacing: -0.5px; color: var(--ink); }
.logo.white span { color: #fff; }

/* ── 카드 / 폼 ── */
.card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 28px;
}
.field { display: block; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); display: block; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  background: var(--surface);
}
.field input:focus { border-color: var(--primary); }

/* ── 인증 화면 ── */
.auth { min-height: 100vh; display: flex; margin-top: -60px;  }
.auth-side {
  flex: 1;
  background: linear-gradient(150deg, var(--primary-dark), var(--primary));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  color: #fff;
}
.auth-side h1 { font-size: 34px; font-weight: 800; margin: 28px 0 0; line-height: 1.3; letter-spacing: -1px; }
.auth-side p { font-size: 16px; opacity: .85; margin-top: 16px; line-height: 1.6; }
.auth-form { width: 460px; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form .inner { width: 100%; max-width: 360px; }
.auth-form h2 { font-size: 24px; font-weight: 800; margin: 24px 0 6px; }
.auth-form .sub { font-size: 14px; color: var(--muted); margin: 0 0 24px; }

.social { display: flex; flex-direction: column; gap: 10px; }
.social button {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  font-weight: 700; font-size: 15px; cursor: pointer; font-family: var(--font);
}
.social .kakao { background: var(--kakao); color: #3C1E1E; }
.social .naver { background: var(--naver); color: #fff; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.divider .l { flex: 1; height: 1px; background: var(--line); }
.divider span { font-size: 12px; color: var(--muted); }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* ── 상단바 ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: 60px; min-height: 60px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.topbar .nav { display: flex; align-items: center; gap: 18px; }
.topbar .nav a { font-size: 14px; font-weight: 600; }

/* ── 햄버거 버튼 (모바일 전용) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px; height: 34px;
  border: none; background: transparent;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 20px; height: 2px; margin: 0 auto;
  background: var(--ink); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary-dark); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; cursor: pointer;
}
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 140px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(14, 26, 36, .12); padding: 6px;
  display: none; flex-direction: column; gap: 2px; z-index: 20;
}
.user-menu.open .user-dropdown { display: flex; }
.user-dropdown a,
.user-dropdown button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--ink); font-family: var(--font); cursor: pointer;
}
.user-dropdown a:hover,
.user-dropdown button:hover { background: var(--paper); }
.user-dropdown button { color: var(--accent); }

.page { max-width: 920px; margin: 0 auto; padding: 40px 24px; }
.page h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.page .lead { font-size: 15px; color: var(--muted); margin: 0 0 28px; }
/* 비밀번호 변경 등 좁은 단일 폼 페이지 — 페이지 컬럼을 좁혀 가운데 정렬 */
.page-narrow { max-width: 480px; }

/* ── 랜딩 ── */
.lnav {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px); z-index: 10;
}
.lnav .right { display: flex; align-items: center; gap: 20px; }
.hero {
  max-width: 1080px; margin: 0 auto; padding: 72px 40px 64px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--primary-dark);
  background: var(--primary-soft); padding: 6px 12px; border-radius: 20px; margin-bottom: 20px;
}
.hero h1 { font-size: 46px; font-weight: 800; line-height: 1.2; letter-spacing: -1.5px; margin: 0; }
.hero h1 .hl { color: var(--primary); }
.hero p { font-size: 17px; color: var(--muted); line-height: 1.7; margin: 20px 0 32px; }
.hero .cta { display: flex; gap: 12px; }
.stats { display: flex; gap: 28px; margin-top: 40px; }
.stats .n { font-size: 22px; font-weight: 800; }
.stats .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hero-art {
  background: linear-gradient(150deg, var(--primary-dark), var(--primary));
  border-radius: 24px; padding: 36px; display: flex; align-items: center; justify-content: center;
}

.section { padding: 72px 40px; }
.section.alt { background: var(--paper); }
.section .head { text-align: center; margin-bottom: 48px; }
.section .head h2 { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin: 0; }
.section .head p { font-size: 16px; color: var(--muted); margin-top: 12px; }
.wrap { max-width: 1080px; margin: 0 auto; }
.wrap-sm { max-width: 720px; margin: 0 auto; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 24px; }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature h3 { font-size: 17px; font-weight: 800; margin: 0 0 8px; }
.feature p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

.price-preview { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.price-chip {
  border: 1px solid var(--line); border-radius: 14px; padding: 20px 28px;
  min-width: 140px; background: var(--surface); text-align: center;
}
.price-chip .name { font-size: 15px; font-weight: 800; }
.price-chip .disc { font-size: 12px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.price-chip .pm { font-size: 22px; font-weight: 800; margin-top: 8px; }
.price-chip .unit { font-size: 12px; color: var(--muted); }

.faq-box { background: var(--surface); border-radius: 16px; border: 1px solid var(--line); padding: 8px 24px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; background: transparent; border: none; padding: 20px 4px;
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  font-family: var(--font); text-align: left; font-size: 16px; font-weight: 700; color: var(--ink);
}
.faq-q .plus { font-size: 20px; color: var(--primary); transition: transform .2s; margin-left: 16px; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { font-size: 15px; color: var(--muted); line-height: 1.7; margin: 0; padding: 0 4px 22px; display: none; }
.faq-item.open .faq-a { display: block; }

.cta-band {
  background: linear-gradient(150deg, var(--primary-dark), var(--primary));
  color: #fff; text-align: center; padding: 64px 40px;
}
.cta-band h2 { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 0 0 16px; }
.cta-band p { font-size: 16px; opacity: .85; margin: 0 0 28px; }

.footer {
  padding: 32px 40px; display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); flex-wrap: wrap; gap: 12px;
}
.footer .copy { font-size: 13px; color: var(--muted); }

/* ── 구독 카드 ── */
.sub-card { padding: 0; overflow: hidden; margin-bottom: 20px; }
.sub-top {
  padding: 24px 28px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.sub-top .plan { font-size: 19px; font-weight: 800; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.badge.trial { color: var(--primary-dark); background: var(--primary-soft); }
.badge.active { color: var(--ok); background: var(--ok-soft); }
.sub-top .meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.sub-top .right { text-align: right; }
.sub-top .right .k { font-size: 12px; color: var(--muted); }
.sub-top .right .v { font-size: 17px; font-weight: 800; }
.sub-bottom { padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; }
.sub-status { display: flex; align-items: center; gap: 10px; }
.sub-status .tag { font-size: 13px; font-weight: 700; color: var(--primary); }
.sub-status .tag.warn { color: var(--warn); }

/* 구독 카드 - 결제 정보 */
.sub-info { padding: 18px 28px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.sub-info .info-row { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.sub-info .il { font-size: 13px; color: var(--muted); }
.sub-info .iv { font-size: 14px; font-weight: 700; }

/* 토글 스위치 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--line);
  border-radius: 24px; transition: background .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 체험 임박 알림 (D-day + 진행바) */
.trial-progress { padding: 18px 28px; border-bottom: 1px solid var(--line); }
.trial-progress .tp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.trial-progress .dday {
  font-size: 13px; font-weight: 800; color: var(--primary-dark);
  background: var(--primary-soft); padding: 4px 10px; border-radius: 8px; letter-spacing: -0.3px;
}
.trial-progress .tp-msg { font-size: 14px; color: var(--ink); }
.trial-progress .tp-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.trial-progress .tp-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.trial-progress.urgent .dday { color: #fff; background: var(--warn); }
.trial-progress.urgent .tp-fill { background: var(--warn); }
.trial-progress.is-hidden { display: none; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.metric { padding: 20px; }
.metric .k { font-size: 13px; color: var(--muted); }
.metric .v { font-size: 24px; font-weight: 800; margin-top: 6px; }

/* ── 플랜 ── */
.plans-wrap { max-width: 620px; margin: 0 auto; padding: 44px 24px; }
.plans-head { text-align: center; margin-bottom: 36px; }
.plans-head h1 { font-size: 28px; font-weight: 800; margin: 0 0 8px; }
.plans-head p { font-size: 15px; color: var(--muted); margin: 0; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.plan-grid:has(> .plan-card:only-child) {
  grid-template-columns: minmax(260px, 320px);
  justify-content: center;
}
.plan-card { padding: 22px; position: relative; display: flex; flex-direction: column; }
.plan-card.featured { border: 2px solid var(--primary); }
.plan-card .rib {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800;
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.plan-card .pname { font-size: 17px; font-weight: 800; }
.plan-card .pterm { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plan-card .pdisc {
  align-self: flex-start; margin-top: 12px; font-size: 12px; font-weight: 800;
  color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 6px;
}
.plan-card .pmonth { margin-top: 14px; }
.plan-card .pmonth .big { font-size: 26px; font-weight: 800; }
.plan-card .pmonth .u { font-size: 13px; color: var(--muted); }
.plan-card .ptotal { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.plan-card .ptotal b { color: var(--ink); }
.plan-card .psave { color: var(--accent); font-weight: 700; }
.plan-card .ptrial { font-size: 12px; color: var(--primary); font-weight: 700; margin-top: 8px; }
.plan-card .grow { flex: 1; }

/* 좁은 화면: 플랜 개수와 무관하게 1열 */
@media (max-width: 560px) {
  .plan-grid,
  .plan-grid:has(> .plan-card:only-child) {
    grid-template-columns: 1fr;
  }
}

/* ── 결제 ── */
.checkout-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.checkout-grid { display: grid; grid-template-columns: 1fr 450px; gap: 24px; align-items: start; }
.h3 { font-size: 16px; font-weight: 800; margin: 0 0 16px; }
.method {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; margin-bottom: 10px;
}
.method.sel,
.method:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.method span { font-size: 14px; font-weight: 600; }
.row { display: flex; justify-content: space-between; padding: 5px 0; }
.row .k { font-size: 14px; color: var(--muted); }
.row .v { font-size: 14px; font-weight: 600; color: var(--ink); }
.row .v.accent { color: var(--accent); }
.row .v.strike { text-decoration: line-through; opacity: .6; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; }
.summary-total .lab { font-size: 15px; font-weight: 700; }
.summary-total .amt { font-size: 24px; font-weight: 800; color: var(--primary); }

/* ── 원격제어 포트 추가 옵션 (스테퍼) ── */
.port-option { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; gap: 12px; }
.port-option .port-info { display: flex; flex-direction: column; gap: 2px; }
.port-option .port-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.port-option .port-unit { font-size: 12px; color: var(--muted); }
.port-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.port-stepper .port-btn {
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 18px; font-weight: 700; color: var(--primary); cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.port-stepper .port-btn:hover:not(:disabled) { background: var(--primary-soft); }
.port-stepper .port-btn:disabled { color: var(--line); cursor: not-allowed; }
.port-stepper .port-count {
  width: 44px; height: 32px; border: none; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--ink); background: transparent;
}
.port-stepper .port-count:focus { outline: none; }
/* 포트 증가/감소 적용 시점 안내 문구 */
.port-notice {
  margin-top: 8px; font-size: 12px; line-height: 1.5;
  color: var(--primary-dark); background: var(--primary-soft);
  border-radius: 8px; padding: 8px 10px;
}
.trial-note {
  background: var(--primary-soft); border-radius: 10px; padding: 10px 12px; margin-top: 12px;
  font-size: 12px; color: var(--primary-dark); line-height: 1.6;
}
.fine { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.5; }
.alert-error {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600; line-height: 1.5;
}
.hr { border-top: 1px solid var(--line); margin: 14px 0; }

/* ── 완료 ── */
.success-wrap { max-width: 520px; margin: 0 auto; padding: 64px 24px; text-align: center; }
.success-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
}
.success-wrap h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.success-wrap .sub { font-size: 15px; color: var(--muted); margin: 0 0 28px; }

/* ── 다운로드 ── */
.dl-wrap { max-width: 880px; margin: 0 auto; padding: 44px 24px; }
.dl-head { text-align: center; margin-bottom: 14px; }
.dl-head h1 { font-size: 28px; font-weight: 800; margin: 0 0 8px; }
.dl-head p { font-size: 15px; color: var(--muted); margin: 0; }
.os-hint {
  text-align: center; font-size: 13px; font-weight: 700; color: var(--primary-dark);
  background: var(--primary-soft); border-radius: 20px; padding: 8px 14px;
  width: fit-content; margin: 0 auto 32px;
}
.dl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.dl-card { padding: 32px 28px; text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; }
.dl-card.current { border: 2px solid var(--primary); }
.dl-card .pill {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800;
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.dl-os { width: 56px; height: 56px; margin-bottom: 16px; }
.dl-card h3 { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.dl-card .ver { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.dl-card .req { font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 18px; text-align: left; width: 100%; }
.dl-card .req b { color: var(--ink); font-weight: 600; }
.dl-grow { flex: 1; }
.perm-note {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 28px; margin-top: 24px;
}
.perm-note h3 { font-size: 16px; font-weight: 800; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.perm-note p { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 0; }
.perm-note code { background: var(--paper); border-radius: 6px; padding: 2px 7px; font-size: 13px; color: var(--ink); }

@media (max-width: 760px) {
  .hero, .checkout-grid { grid-template-columns: 1fr; }
  .features, .metrics, .dl-grid { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { width: 100%; }

  .topbar { padding: 0 20px; }
  .hamburger { display: flex; }
  .topbar .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(14, 26, 36, .1);
    padding: 8px 20px 16px; z-index: 30;
  }
  .topbar .nav.open { display: flex; }
  .topbar .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .topbar .nav .user-menu { border-bottom: 1px solid var(--line); }
  .topbar .nav .user-menu:last-child,
  .topbar .nav a:last-of-type { border-bottom: none; }
}
/* 오버레이 */
.pay-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 26, 36, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pay-overlay.is-open { display: flex; }

/* 모달 컨테이너 – .card 위에 크기/레이아웃만 추가 */
.pay-modal {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  /* .card 에서 border-radius:16px, border, background 상속 */
}

/* 헤더 */
.pay-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
}
.pay-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  margin: 0;
}

/* 닫기 */
.pay-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .15s;
  z-index: 2;
}
.pay-close:hover { background: var(--line); }

/* 바디 2열 */
.pay-body {
  display: grid;
  grid-template-columns: 1fr 300px;
}

/* 좌 영역 */
.pay-left {
  padding: 24px 28px;
  border-right: 1px solid var(--line);
}

/* 우 영역 */
.pay-right {
  padding: 24px 22px;
  background: var(--paper);
  border-radius: 0 0 16px 0;
}

/* 섹션 레이블 */
.pay-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* 사용자 정보 행 */
.pay-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.pay-sep { color: var(--line); }
.pay-ico {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

/* 선택된 카드 */
.pay-card-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
  margin-bottom: 12px;
}
.pay-card-selected-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}
.pay-card-selected-actions { display: flex; gap: 8px; }

/* 링크형 버튼 */
.pay-link-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
}
.pay-link-btn:hover { text-decoration: underline; }

/* 카드 목록 */
.pay-card-list { margin-bottom: 10px; }
.pay-card-list .method { 
  margin-bottom: 6px; 
}
.pay-card-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pay-card-row .method { flex: 1; margin-bottom: 0; }
.pay-card-row .pay-link-btn { flex: 0 0 auto; }

/* 신규 카드 추가 버튼 */
.pay-add-card-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: 1.5px dashed var(--primary);
  border-radius: 10px;
  padding: 10px 14px;
  width: 100%;
  font-family: var(--font);
  transition: background .15s;
  margin: 10px 0 16px;
}
.pay-add-card-btn:hover { background: var(--primary-soft); }

/* 카드 입력 폼 */
.pay-card-form {
  background: var(--paper);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 4px;
}

/* 주문 요약 우측 */
.pay-notice-link {
  font-size: 12px;
  color: var(--primary);
  display: block;
  margin: 4px 0 12px;
}

/* 반응형 */
@media (max-width: 680px) {
  .pay-body { grid-template-columns: 1fr; }
  .pay-left  { border-right: none; border-bottom: 1px solid var(--line); padding: 20px; }
  .pay-right { border-radius: 0 0 16px 16px; padding: 20px; background: var(--paper); }
}

 
/* 취소 텍스트 버튼 */
.btn-cancel-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.btn-cancel-link:hover { color: var(--danger, #A32D2D); }
 
/* 취소 배지 */
.badge.cancelled {
  background: #FCEBEB;
  color: #A32D2D;
}
 
/* 모달 배경 — position:fixed 대신 .page 기준 */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.42);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
 
.modal-box {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 32px 28px 24px;
  width: 100%;
  max-width: 420px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}
.modal-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-danger {
  background: #FCEBEB;
  color: #A32D2D;
  border: 1px solid #F7C1C1;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-danger:hover   { opacity: .85; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* ── 결제 내역 링크 버튼 (대시보드 결제 정보) ── */
.btn-history-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}
.btn-history-link:hover { text-decoration: underline; }

/* ── 결제 내역 모달 ── */
.history-modal-box { max-width: 560px; }
.history-body {
  max-height: 52vh;
  overflow-y: auto;
  margin-top: 4px;
}
.history-empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 32px 0;
  margin: 0;
}
.history-list { display: flex; flex-direction: column; }
.history-row {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.history-row:last-child { border-bottom: none; }
.history-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.history-name   { font-size: 14px; font-weight: 600; color: var(--ink); }
.history-amount { font-size: 14px; font-weight: 800; white-space: nowrap; }
.history-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.history-meta { font-size: 12px; color: var(--muted); }
.history-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.history-status.done { background: #E7F5EE; color: #1B7F4B; }
.history-status.fail { background: #FCEBEB; color: #A32D2D; }
 
/* ── 이용약관·개인정보처리방침 모달 ── */
.legal-modal-box {
  max-width: 820px;
  width: 100%;
  max-height: 86vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.legal-modal-head .modal-title { margin: 0; }
.legal-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.legal-modal-close:hover { color: var(--ink); }
.legal-frame {
  border: 0;
  width: 100%;
  height: 70vh;
  display: block;
}
 