/* FRAMEFORM members pages (/account/, /signup/, /q/, /lookup/, /legal/*).
   Builds on css/styles.css tokens; loaded only on these pages. */

.m-header .header-inner { gap: 0.75rem; }
.mnav { display: flex; align-items: center; gap: 0.25rem 1rem; flex-wrap: wrap; font-size: var(--fs-sm); }
.mnav a { color: var(--silver); text-decoration: none; padding: 0.4rem 0.1rem; min-height: 44px; display: inline-flex; align-items: center; }
.mnav a:hover, .mnav a[aria-current="page"] { color: var(--white); }
.mnav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 6px; }
@media (max-width: 520px) { .mnav .mnav-optional { display: none; } }

.m-main { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(3.5rem, 8vw, 6rem); min-height: 70vh; }
.m-narrow { max-width: 40rem; }
.m-mid { max-width: 56rem; }
.m-eyebrow { font-family: var(--font-display); font-size: var(--fs-xs); letter-spacing: 0.2em; color: var(--orange); text-transform: uppercase; margin-bottom: 0.75rem; }
.m-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.25; letter-spacing: -0.01em; }
.m-lead { color: var(--silver); margin-top: 0.75rem; }
.m-h2 { font-size: var(--fs-lg); font-weight: 650; margin: 2.5rem 0 1rem; }
.m-h3 { font-size: var(--fs-md); font-weight: 650; }
.m-h4 { font-size: var(--fs-sm); font-weight: 650; margin: 1.25rem 0 0.5rem; color: var(--silver); }
.m-muted { color: var(--silver); font-size: var(--fs-sm); }
.m-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.m-pre { white-space: pre-line; }
.m-error { color: var(--error); font-size: var(--fs-sm); margin-top: 0.5rem; }
.m-error:empty { display: none; }

.m-card {
  background: var(--blue-950); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: clamp(1.1rem, 3vw, 1.75rem); margin-top: 1.25rem;
}
.m-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.m-actions { display: grid; gap: 0.6rem; margin-top: 1rem; }
@media (min-width: 560px) { .m-actions-row { grid-auto-flow: column; justify-content: start; } }

.m-notice { border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 0.9rem 1rem; margin-top: 1rem; font-size: var(--fs-sm); color: var(--silver); }
.m-notice strong { color: var(--white); }
.m-notice p { margin-top: 0.35rem; }
.m-notice-warn { border-color: rgba(255, 138, 61, 0.55); }
.m-notice-ok { border-color: rgba(143, 224, 176, 0.45); color: var(--success); }
.m-draft-banner { background: rgba(255, 138, 61, 0.12); border: 1px solid rgba(255, 138, 61, 0.55); color: var(--white); padding: 0.9rem 1rem; border-radius: var(--radius-s); margin: 1.25rem 0 2rem; font-size: var(--fs-sm); }

.m-badge { display: inline-block; font-size: var(--fs-xs); font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--silver); white-space: nowrap; }
.m-badge-sent, .m-badge-open, .m-badge-accepted, .m-badge-partially_paid { border-color: var(--orange); color: var(--orange); }
.m-badge-paid { border-color: rgba(143, 224, 176, 0.6); color: var(--success); }

/* login */
.login-buttons { display: grid; gap: 0.65rem; margin-top: 1.5rem; }
.login-btn { font-weight: 650; border: 1px solid transparent; }
.login-google { background: #ffffff; color: #1f1f1f; }
.login-google:hover { background: #f1f3f4; }
.login-kakao { background: #fee500; color: rgba(0, 0, 0, 0.85); }
.login-kakao:hover { background: #f5dc00; }
.login-naver { background: #03c75a; color: #ffffff; }
.login-naver:hover { background: #02b351; }
.login-btn[disabled] { background: transparent; color: var(--silver); border-color: var(--line-strong); }
.login-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; }
.login-ico { width: 18px; height: 18px; flex: none; display: block; }
.login-kakao .login-ico path { fill: #000000; }
.login-naver .login-ico path { fill: #ffffff; }
.login-btn[disabled] .login-ico { opacity: 0.55; }
.login-btn[disabled] .login-ico path { fill: currentColor; }

/* timeline */
.m-timeline { display: grid; gap: 0; margin-top: 0.5rem; counter-reset: step; }
.m-timeline li { position: relative; display: grid; grid-template-columns: 1.25rem 1fr auto; align-items: center; gap: 0.75rem; padding: 0.45rem 0; font-size: var(--fs-sm); color: var(--silver-dim); }
.m-timeline li::before { content: ''; position: absolute; left: calc(0.625rem - 0.5px); top: 1.4rem; bottom: -0.45rem; width: 1px; background: var(--line); }
.m-timeline li:last-child::before { display: none; }
.m-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 1px solid var(--line-strong); justify-self: center; background: var(--black); position: relative; z-index: 1; }
.m-timeline .is-done { color: var(--silver); }
.m-timeline .is-done .m-dot { background: var(--silver); border-color: var(--silver); }
.m-timeline .is-current { color: var(--white); font-weight: 650; }
.m-timeline .is-current .m-dot { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.2); }
.m-step-date { font-size: var(--fs-xs); color: var(--silver-dim); font-weight: 400; }

/* tables & lists */
.m-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.m-table th, .m-table td { padding: 0.6rem 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.m-table td { text-align: right; white-space: nowrap; padding-left: 1rem; }
.m-table tfoot th, .m-table tfoot td { border-bottom: 0; padding-top: 0.9rem; font-size: var(--fs-base); }
.m-charges, .m-list { display: grid; gap: 0.4rem; margin-top: 1rem; font-size: var(--fs-sm); }
.m-charges li, .m-list li { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-s); }
.m-orders { display: grid; gap: 0.6rem; margin-top: 1rem; }
.m-order-link { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-m); text-decoration: none; background: var(--blue-950); }
.m-order-link:hover { border-color: var(--line-strong); }
.m-order-no { font-weight: 650; }
.m-order-meta { grid-column: 1 / -1; color: var(--silver); font-size: var(--fs-xs); }
.m-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin-top: 0.9rem; font-size: var(--fs-sm); }
.m-dl dt { color: var(--silver); }
.m-dl dd { min-width: 0; }
.m-amount { font-size: var(--fs-lg); font-weight: 700; color: var(--orange); }
.m-bank { margin-top: 1.25rem; padding: 1.1rem; border: 1px solid rgba(255, 138, 61, 0.5); border-radius: var(--radius-m); }
.m-bank > .m-muted { margin-top: 0.75rem; }
.m-accept { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.m-check { align-items: flex-start !important; line-height: 1.55; }
.m-check input { margin-top: 0.2rem !important; }
.m-check a { color: var(--white); }

.m-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-top: 2rem; overflow-x: auto; }
.m-tabs a { padding: 0.75rem 1rem; text-decoration: none; color: var(--silver); border-bottom: 2px solid transparent; white-space: nowrap; min-height: 44px; }
.m-tabs a[aria-current="page"] { color: var(--white); border-bottom-color: var(--orange); }
.m-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--silver); text-decoration: none; font-size: var(--fs-sm); }
.m-back:hover { color: var(--white); }
.m-grid2 { display: grid; gap: 1.25rem; }
@media (min-width: 820px) { .m-grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }

/* legal */
.legal { max-width: 46rem; }
.legal h2 { font-size: var(--fs-md); font-weight: 650; margin: 2.25rem 0 0.75rem; }
.legal h3 { font-size: var(--fs-base); font-weight: 650; margin: 1.5rem 0 0.5rem; }
.legal p, .legal li { color: var(--silver); font-size: var(--fs-sm); }
.legal p + p { margin-top: 0.6rem; }
.legal ul, .legal ol { list-style: disc; padding-left: 1.25rem; display: grid; gap: 0.35rem; margin-top: 0.5rem; }
.legal ol { list-style: decimal; }
.legal table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: 0.75rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; color: var(--silver); }
.legal th { color: var(--white); font-weight: 600; background: var(--blue-950); }
.legal .todo { color: var(--orange); font-weight: 600; }
.legal-meta { color: var(--silver-dim); font-size: var(--fs-xs); margin-top: 0.5rem; }
.table-scroll { overflow-x: auto; }

/* narrow screens: logo + KO|EN on the first row, menu links on the second */
@media (max-width: 520px) {
  .m-header .header-inner { flex-wrap: wrap; height: auto; min-height: var(--header-h); padding-block: 0.25rem; row-gap: 0; }
  .m-header .mnav { order: 3; width: 100%; gap: 0 1.1rem; }
  .m-header .mnav a { min-height: 40px; }
}

/* points & coupons (phase 1C) */
.m-wallet-balance { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 650; color: var(--orange); line-height: 1.15; margin: 0.25rem 0 0.5rem; }
.m-discounts { border: 1px solid var(--line-strong); border-radius: var(--radius-m); padding: 1rem 1.1rem; display: grid; gap: 0.25rem; }
.m-discounts .m-h4 { margin-top: 0; }
.m-points-row { display: flex; gap: 0.5rem; align-items: stretch; }
.m-points-row input { flex: 1 1 auto; min-width: 0; }
.m-discounts select, .m-points-row input {
  width: 100%; min-height: 44px; padding: 0.55rem 0.75rem; background: var(--black); color: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
}
.m-discounts select:focus-visible, .m-points-row input:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.m-table .m-disc th, .m-table .m-disc td { color: var(--success); }
/* gift code entry: collapsed and quiet inside the coupon card */
.m-gift { margin-top: 1rem; }
.m-gift summary { cursor: pointer; font-size: 0.875rem; width: fit-content; }
.m-gift-form { margin-top: 0.75rem; max-width: 22rem; }
.m-gift-form input { text-transform: uppercase; letter-spacing: 0.04em; }
.m-plus { color: var(--success); font-weight: 600; white-space: nowrap; }
.m-minus { color: var(--silver); white-space: nowrap; }
