/* Member area pages: me.html · member.html · report.html · status.html (handoff v5 H1 M1-info · H2 M2-apps · H3 M3-scores ·
   M3r-real-scores · H4 M4-leave · K6 · K7 · K8). Loaded after style.css. Words, ids, names, hooks and element order stay as
   the pages build them; the rows are styled by structure. Rules here:
   - an element that can carry the [hidden] attribute or the shared .hidden class only gets a display value through
     :not([hidden]) / :not(.hidden), so hiding keeps working;
   - no border or background reaches a control marked .bad (report.js), so its 2px error border from style.css stays. */

/* One 560px column, as the boards (56px above the content on PC). */
main.member-page { max-width: 608px; margin: 0 auto; padding: 56px 24px 72px; }
main.member-page h1 { margin: 0 0 24px; font-size: 32px; line-height: 1.3; letter-spacing: -0.01em; }
main.member-page h2 { margin: 48px 0 12px; font-size: 18px; line-height: 1.4; }
main.member-page section > p, main.member-page section > form { margin: 0 0 12px; }
main.member-page .status { font-size: 14px; line-height: 1.7; }

/* Buttons: the design's outlined 48px button; the form's main action filled (K8 primary). */
main.member-page button { min-height: 48px; padding: 0 22px; font-size: 16px; }
#email-change-submit:not(:disabled), #phone-send:not(:disabled), #phone-confirm:not(:disabled) { background: var(--mn-burgundy); border-color: var(--mn-burgundy); color: var(--mn-ivory); }
#email-change-submit:not(:disabled):hover, #phone-send:not(:disabled):hover, #phone-confirm:not(:disabled):hover { background: var(--mn-burgundy-deep); border-color: var(--mn-burgundy-deep); }
#email-change-submit:not(:disabled):active, #phone-send:not(:disabled):active, #phone-confirm:not(:disabled):active { background: var(--mn-burgundy-pressed); }

/* Fields (K7 · K8): name above, a 52px paper field below; hover darkens the edge, a field left invalid gets the error edge. */
main.member-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width: 100%; height: 52px; padding: 0 14px; font-size: 17px; }
main.member-page input:not([type="checkbox"]):not([type="radio"]):not(.bad), main.member-page select:not(.bad) { background-color: var(--mn-paper); }
main.member-page input:not([type="checkbox"]):not([type="radio"]):not(.bad):not(:disabled):hover, main.member-page select:not(.bad):not(:disabled):hover { border-color: var(--mn-charcoal); }
main.member-page input:not([type="checkbox"]):not([type="radio"]):not(.bad):user-invalid, main.member-page select:not(.bad):user-invalid { border: 2px solid var(--mn-error); }
main.member-page input:not([type="checkbox"]):not([type="radio"]):disabled, main.member-page select:disabled { background-color: var(--mn-disabled-bg); border-color: var(--mn-disabled-bg); color: var(--mn-disabled-text); cursor: not-allowed; }
main.member-page input[type="checkbox"] { flex: 0 0 auto; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--mn-charcoal); }

/* A message line that holds an error: the design's alert box (K6 · K7), only while it has words. */
main.member-page p.error:not(:empty) { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--mn-error); background: var(--mn-paper); font-size: 15px; font-weight: 600; line-height: 1.6; }

/* ── me.html ─────────────────────────────────────────────────────────────────────────────────────────────── */

/* 내 정보 (M1): a name column and its value, rows between hair lines. me.js puts each name and value in its own span. */
#diagnosis-opening:not(:empty) { margin: 0 0 16px; }
#info { border-bottom: 1px solid var(--mn-line); }
#info > p { margin: 0; }
#info > p.kv { display: grid; grid-template-columns: 108px minmax(0, 1fr); }
#info .kv-k, #info .kv-v { padding: 14px 0; border-top: 1px solid var(--mn-line); }
#info .kv-k { grid-column: 1; padding-right: 12px; font-size: 14px; line-height: 1.6; color: var(--mn-ink2); }
#info .kv-v { grid-column: 2; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
#info .kv-sep { display: none; }
#info #email-change-open { grid-column: 2; justify-self: start; margin: 0 0 14px; }
/* A note under a row reads with that row: no line of its own, set in under the value. */
#info > p.status { margin-top: -6px; padding: 0 0 12px 108px; font-size: 13px; line-height: 1.6; }

/* 이메일 바꾸기 · 휴대폰 인증: name above field, buttons in a row. */
#email-change-fields { min-inline-size: 0; margin: 0 0 12px; padding: 0; border: 0; }
#email-change-fields > p { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
#email-change-fields label, #phone-start > label, #phone-verify > label { font-size: 15px; font-weight: 600; }
#email-change-fields > button { margin: 0 8px 8px 0; }
#phone-start:not([hidden]), #phone-verify:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
#phone-start > label, #phone-verify > label { grid-column: 1 / -1; }
#phone-verify > #phone-resend, #phone-verify > #phone-edit { justify-self: start; }
#phone-timer:empty, #phone-message:empty, #email-change-message:empty, #alert-message:empty, #alert-state:empty, #withdraw-message:empty { margin: 0; }

/* 무료 진단 공개 알림 (consent text unchanged): the notice set as small type above its button. */
#alert-offer > p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--mn-ink2); }

/* 내 사전 신청 (M2): the table read as the design's list — each application a block between hair lines; the column name
   comes back in front of the values that need it (data-label, set by me.js). The header row stays for screen readers. */
#my-applications-list table, #my-applications-list tbody { display: block; }
#my-applications-list table { border-top: 1px solid var(--mn-charcoal); font-size: 15px; }
#my-applications-list caption, #my-applications-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#my-applications-list tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--mn-line); }
#my-applications-list tbody td { display: block; grid-column: 1 / -1; padding: 0; border: 0; line-height: 1.5; }
#my-applications-list tbody td:nth-child(1) { font-size: 13px; color: var(--mn-ink2); font-variant-numeric: tabular-nums; }
#my-applications-list tbody td:nth-child(2) { font-size: 16px; font-weight: 700; }
#my-applications-list tbody td:nth-child(n+3):nth-child(-n+5) { font-size: 14px; font-variant-numeric: tabular-nums; }
#my-applications-list tbody td:nth-child(3) { font-size: 15px; }
#my-applications-list tbody td:nth-child(n+3):nth-child(-n+5)::before { content: attr(data-label); margin-right: 8px; color: var(--mn-ink2); }
#my-applications-list tbody td:nth-child(5) { grid-column: 1; }
#my-applications-list tbody td:nth-child(6) { grid-column: 2; align-self: end; text-align: right; }
#my-applications-list tbody td:nth-child(6) a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; color: var(--mn-charcoal); font-size: 14px; font-weight: 600; text-underline-offset: 4px; white-space: nowrap; }
#my-applications-list > p { margin: 0; padding: 16px 0; border-top: 1px solid var(--mn-charcoal); border-bottom: 1px solid var(--mn-line); font-size: 15px; }
#my-applications > p:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 16px; }
#my-applications-open { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; }

/* 입력한 성적 (M3): one line per score record between hair lines. */
#scores:not(:empty) { border-bottom: 1px solid var(--mn-line); }
#scores > p { margin: 0; padding: 11px 0; border-top: 1px solid var(--mn-line); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#scores > p.status { font-size: 14px; }
#scores > p.error:not(:empty) { margin: 0; }

/* 선택 동의 (M1 광고성 정보 row; consent text unchanged): the tick and its words, 저장 beside. */
main.me-page > .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-top: 1px solid var(--mn-line); border-bottom: 1px solid var(--mn-line); }
main.me-page > .row > label { display: flex; flex: 1 1 280px; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.6; cursor: pointer; }

/* 로그아웃 · 탈퇴 (M1): 탈퇴 as the design's small underlined word under the buttons (the words are unchanged). */
.account-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin: 48px 0 0; }
#withdraw { min-height: 44px; padding: 0; border-color: transparent; background: transparent; color: var(--mn-ink2); font-size: 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
#withdraw:not(:disabled):hover { color: var(--mn-charcoal); text-decoration-thickness: 2px; }
#withdraw:disabled { color: var(--mn-disabled-text); text-decoration: none; }
#withdraw-social-note { margin: 4px 0 0; font-size: 13px; }

/* ── report.html (M3r): subject rows with the three score boxes under one header ─────────────────────────────── */
.report-page .score-head, .report-page #fields .row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 64px 56px; column-gap: 8px; }
.report-page .score-head { padding: 0 0 6px; font-size: 13px; color: var(--mn-ink2); }
.report-page .score-head > span:not(:first-child) { text-align: center; }
.report-page #fields { border-bottom: 1px solid var(--mn-line); }
.report-page #fields .row { row-gap: 6px; align-items: center; margin: 0; padding: 10px 0; border-top: 1px solid var(--mn-line); }
.report-page #fields .row > strong { grid-column: 1; grid-row: 1; align-self: end; font-size: 15px; font-weight: 600; line-height: 1.4; }
.report-page #fields .row > select { grid-column: 1; grid-row: 2; width: 100%; }
.report-page #fields .row > input { grid-row: 1 / span 2; }
.report-page #fields [name$="_standard"] { grid-column: 2; }
.report-page #fields [name$="_percentile"] { grid-column: 3; }
.report-page #fields input[name$="_grade"] { grid-column: 4; }
.report-page #fields .row > [name="foreign_subject"] { grid-column: 1 / 3; }
.report-page #fields .row > [name="foreign_grade"] { grid-column: 3 / -1; grid-row: 2; }
.report-page #fields input[type="number"] {
  width: 100%; height: 44px; padding: 0 4px; font-size: 16px; text-align: center; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.report-page #fields input[type="number"]::placeholder { font-size: 12px; }
.report-page #fields input[type="number"]::-webkit-inner-spin-button, .report-page #fields input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.report-page select {
  height: 44px; min-height: 44px; padding: 0 32px 0 12px; font-size: 16px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232D2528' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.report-page #fields p.status { grid-column: 1 / -1; margin: 0; padding: 12px 0; border-top: 1px solid var(--mn-line); font-size: 13px; }

/* 수험번호 · 성적통지표 · 확인 tick: name above a full-width field; the notice and the confirm box (text unchanged). */
.report-page #f > .row { display: block; margin: 24px 0 0; }
.report-page #f > .row[hidden] { display: none; }
.report-page #f > .row > label { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; }
.report-page #f > .row > label:has(> input[type="checkbox"]) { flex-direction: row; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; font-weight: 400; cursor: pointer; }
.report-page #f > .row input[type="file"] { width: 100%; min-height: 52px; padding: 12px 14px; font-size: 15px; font-weight: 400; }
.report-page #f > .row input[name="exam_number"] { font-variant-numeric: tabular-nums; font-weight: 400; }
.report-page #f > p.status { margin: 16px 0 0; }
.report-page [data-role="score-confirm-notice"] { display: flex; flex-direction: column; gap: 8px; margin: 24px 0 0; padding: 14px 16px; border: 1px solid var(--mn-charcoal); background: var(--mn-paper); }
.report-page [data-role="score-confirm-notice"] p { margin: 0; font-size: 14px; line-height: 1.75; }
.report-page [data-role="score-confirm-notice"] p:first-child { font-size: 15px; line-height: 1.6; }
/* 자동 계산과 비교 (outlined) above 제출 (filled, the page's main action), both full width. */
.report-page #check, .report-page #f > button.primary { display: flex; align-items: center; justify-content: center; width: 100%; }
.report-page #check { margin-top: 32px; }
.report-page #f > button.primary { min-height: 56px; margin-top: 8px; font-weight: 600; }
.report-page #mm:not(:empty) { margin: 16px 0 0; color: var(--mn-charcoal); font-size: 15px; font-weight: 600; }

/* ── status.html: the steps as a band, the current step marked ───────────────────────────────────────────── */
#steps { display: flex; gap: 4px; margin: 0 0 24px; }
#steps > span { flex: 1 1 0; min-width: 0; margin: 0; padding-top: 10px; border-top: 3px solid var(--mn-line); font-size: 14px; line-height: 1.4; }
#steps > span.on { border-top-color: var(--mn-charcoal); }
.status-page #detail { margin: 0; font-size: 16px; line-height: 1.7; }
#again:not(.hidden) { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 24px; padding: 0 22px; border: 1px solid var(--mn-charcoal); border-radius: var(--mn-radius); color: var(--mn-charcoal); font-size: 16px; font-weight: 600; text-decoration: none; }
#again:not(.hidden):hover { background: var(--mn-tint-hover); }

@media (max-width: 480px) {
  main.member-page { padding: 28px 16px 48px; }
  main.member-page h1 { font-size: 24px; }
  main.member-page h2 { margin-top: 40px; }
  #info > p.status { padding-left: 0; }
}
/* Under 244px (a phone at 200 % zoom) the 108px name column left the value 55–103px: a phone number broke in two or three,
   and under 212px the '이메일 바꾸기' button ran past the right edge and the whole page scrolled sideways. Each name stands
   over its value; from 244px the phone number is on one line beside its name and the rows are as before. */
@media (max-width: 243px) {
  #info > p.kv { grid-template-columns: minmax(0, 1fr); }
  #info .kv-k, #info .kv-v, #info #email-change-open { grid-column: 1; }
  #info .kv-k { padding-bottom: 0; }
  #info .kv-v { border-top: 0; padding-top: 2px; }
}

/* 원장 2393: raw scores are entered, and confirmed scores shown, on the account page in the score page's own fields. Their
   rules are score-fields.css (one copy, loaded after this sheet); score.css is not loaded here — its page-wide rules would
   restyle this page's message line and rows. Below: what only this page adds. */
#scores #f { margin: 12px 0 0; }
#scores .score-next { display: inline-flex; align-items: center; min-height: 44px; }
/* X-CC2 G6-1: this page's column is 448px where the score page's is 720px, so with the shared columns (a 136px name)
   the subject choice had 112px and cut '언어와매체'. Here the name takes 96px (as the shared sheet does at 481 ~ 519), and
   a row of two scores keeps its two-column form (the shared sheet's form under 640) at every width. */
@media (min-width: 520px) {
  #scores #fields .row:not(.raw-split-row) { grid-template-columns: 96px minmax(0, 1fr) 120px 44px; }
  #scores #fields .row:has(> [name="foreign_grade"]) { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 640px) {
  #scores #fields .raw-split-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #scores #fields .raw-split-row > strong { grid-column: 1; }
}
