/* The score fields (원장 2393 · D-CC3 22:05): one copy of the rules for the rows MN.scoreFields builds, the exam number, the save
   button with its notice, and the locked look of confirmed scores. Loaded after score.css on score-raw.html and calc.html
   and after member-area.css on me.html, whose #scores box holds the same form (#f · #fields). The rules are score.css's own,
   moved here as they were; score.css keeps what belongs to the score pages only (the column, the message line, calc's modes
   and search row). Form only: a control the shared sheet marks .bad keeps its look. */

/* Selects drawn as the design's (K8: the device look is off, the arrow is ours). */
main select {
  height: 52px; padding: 0 36px 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 14px center;
}
main select:not(.bad), #fields input:not(.bad), #f > .row input:not(.bad) { background-color: var(--mn-paper); }
main select:not(.bad):not(:disabled):hover, #fields input:not(.bad):not(:disabled):hover, #f > .row input:not(.bad):not(:disabled):hover { border-color: var(--mn-charcoal); }
main select:disabled, #fields input:disabled, #f > .row input:disabled { background-color: var(--mn-disabled-bg); border-color: var(--mn-disabled-bg); color: var(--mn-disabled-text); cursor: not-allowed; }
/* The error look (K7): a field the member left invalid, as the browser tells it, gets the 2px error border. */
#fields input:user-invalid, #fields select:user-invalid, #f > .row input:user-invalid { border: 2px solid var(--mn-error); }

/* One subject per row: name · subject choice · score (S1-score-pc right column: rows between hair lines, a 120px field). */
#fields .row {
  display: grid; grid-template-columns: 136px minmax(0, 1fr) 120px 44px; align-items: center; gap: 12px;
  margin: 0; padding: 10px 0; border-top: 1px solid var(--mn-line);
}
#fields .row > strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
#fields .row > select { width: 100%; }
#fields .row > input { grid-column: 3; }
/* The maximum after a raw-score field (B2 · B3 '/ 100'), and the empty-field line under its row (P new line #3 · K7). */
#fields .row > .out-of { grid-column: 4; color: var(--mn-ink2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#fields .row > .field-error { grid-column: 1 / -1; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
#fields input[type="number"] {
  width: 100%; height: 52px; padding: 0 14px; font-size: 17px; text-align: center; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
#fields input[type="number"]::-webkit-inner-spin-button, #fields input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#fields .row:has(> [name="foreign_grade"]) { grid-template-columns: 136px minmax(0, 1fr) minmax(0, 1fr); }
#fields p.status { margin: 0; padding-top: 12px; border-top: 1px solid var(--mn-line); }

/* The exam number: its name above a full-width field (S3-confirm 수험번호). */
#f > .row { display: block; margin: 24px 0 0; }
#f > .row[hidden] { display: none; }
#f > .row > label { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; }
#f > .row > .hint { margin: 8px 0 0; line-height: 1.6; }
/* The empty exam-number line (P 08:55), the same weight as a score row's own line. */
#f > .row > .field-error { margin: 8px 0 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
#f > .row input { width: 100%; height: 52px; padding: 0 14px; font-size: 17px; font-weight: 400; font-variant-numeric: tabular-nums; }

/* Saving scores (the disclosure below the save button on score-raw stays in score.css). */
#f > button.primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 24px; font-size: 16px; font-weight: 600; }
#save-notice { margin: 24px 0 8px; font-size: 14px; line-height: 1.6; }
#save-notice + #next { margin-top: 0; }
#lock-wait { margin: 8px 0 0; text-align: center; font-size: 14px; line-height: 1.6; color: var(--mn-charcoal); }

@media (max-width: 480px) {
  /* S2-scores-m: name over the row; the subject choice and a 104px score field side by side; a row without a choice keeps
     its name beside the field. Without :has the name simply stays on its own line. */
  #fields .row { grid-template-columns: minmax(0, 1fr) 104px 44px; gap: 8px 12px; padding: 12px 0; }
  #fields .row > strong { grid-column: 1 / -1; font-size: 16px; }
  #fields .row:not(:has(> select)) > strong { grid-column: 1; }
  #fields .row > input { grid-column: 2; }
  #fields .row > .out-of { grid-column: 3; }
  #fields .row:has(> [name="foreign_grade"]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #fields input[type="number"] { font-size: 19px; }
}
/* 481–519: the wide form on a 433–471px column left the subject choice 97px and cut its name; a narrower name column
   (after the row rules above: the same weight, so the later one holds). */
@media (min-width: 481px) and (max-width: 519px) {
  #fields .row { grid-template-columns: 96px minmax(0, 1fr) 120px 44px; }
  #fields .row:has(> [name="foreign_grade"]) { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); }
}
/* Under 360px the subject choice had 68px for its name and a five-letter name lost its last letter ('화법과작문' at 320):
   a narrower score field and a tighter choice give the name its room (both score pages: the same rows). */
@media (max-width: 359px) {
  #fields .row { grid-template-columns: minmax(0, 1fr) 88px 40px; column-gap: 8px; }
  #fields .row:has(> [name="foreign_grade"]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #fields .row > select { padding: 0 30px 0 10px; background-position: right 10px center; }
  #fields input[type="number"] { padding: 0 6px; }
}
/* Under 312px (a phone at 200 % zoom) the choice no longer fits beside the field: the name, the choice, then the field
   with its maximum. */
@media (max-width: 311px) {
  #fields .row, #fields .row:has(> [name="foreign_grade"]) { grid-template-columns: minmax(0, 1fr) 40px; }
  #fields .row > strong, #fields .row:not(:has(> select)) > strong, #fields .row > select { grid-column: 1 / -1; }
  #fields .row > input { grid-column: 1; }
  #fields .row > .out-of { grid-column: 2; }
}

/* Keep each raw common/elective score beside its own maximum. The select and both inputs retain their 52px height. */
#fields .raw-split-row { grid-template-columns: 136px minmax(0, 1fr) repeat(2, 138px); }
#fields .raw-score-part {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0;
}
/* 공통 · 선택 over their fields (the score page asks for it, app.js rawPart): the word still reads once a score is typed, where
   a placeholder is gone. It takes a line of its own above the field and its maximum. */
#fields .raw-part-name { grid-column: 1 / -1; color: var(--mn-ink2); font-size: 14px; line-height: 1.4; }
/* With the word above them the two fields stand lower than the row's middle: the subject's name and its choice go down to the
   fields' line (measured at 1280: the choice stood 14px above the fields). */
#fields .raw-split-row:has(.raw-part-name) > :is(strong, select) { align-self: end; }
#fields .raw-split-row:has(.raw-part-name) > strong { display: flex; align-items: center; min-height: 52px; }
#fields .raw-score-part input { min-width: 0; }
#fields .raw-score-part .out-of { color: var(--mn-ink2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#fields .raw-split-hint { margin: 0 0 12px; color: var(--mn-ink2); font-size: 14px; line-height: 1.6; }
@media (max-width: 639px) {
  #fields .raw-split-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #fields .raw-split-row > strong { grid-column: 1; }
}
@media (max-width: 311px) {
  #fields .raw-split-row { grid-template-columns: minmax(0, 1fr); }
}
/* 원장 2384: confirmed scores are shown filled in and locked — the grey of a locked control, with the value still easy to
   read (#675C5F on #E7DED5 = 4.8:1; Safari would otherwise fade a locked field's text). */
.score-locked :is(input, select):disabled { background: var(--mn-disabled-bg); border-color: var(--mn-disabled-bg); color: var(--mn-ink2); -webkit-text-fill-color: var(--mn-ink2); opacity: 1; cursor: not-allowed; }
#locked-notice:focus { outline: none; }
/* 원장 2435 ② (D-CC3 UXUI_FREE_FLOW_2435 3 절): the phone's two steps on score-raw. A part the step does not show is hidden
   by its attribute, which the form's own display rules would otherwise outrank. Each step's head is the band's word; the
   second step's lands under the site header when focused. The chosen subject stands in small type under its name. */
#f [hidden], .score-step-head[hidden] { display: none !important; }
.score-step-head { margin: 0 0 12px; font-size: 17px; font-weight: 700; line-height: 1.45; scroll-margin-top: 76px; }
.score-step-head:focus { outline: none; }
.score-step-head:focus-visible { outline: 2px solid var(--mn-charcoal); outline-offset: 4px; }
#f .score-step-choice { grid-column: 1 / -1; display: block; margin-top: 2px; color: var(--mn-ink2); font-size: 13px; font-weight: 400; line-height: 1.5; }
#f > .score-step-back { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 12px; border: 1px solid var(--mn-charcoal); border-radius: var(--mn-radius); background: transparent; color: var(--mn-charcoal); font-size: 16px; font-weight: 600; }
#f > .score-step-back:hover { background: var(--mn-tint-hover); }
#f > .score-step-back:focus-visible { outline: 2px solid var(--mn-charcoal); outline-offset: 2px; }

