/* ==========================================================================
   subject.html 전용 미세 스타일. design-system.css·checker.css의 컴포넌트를
   그대로 쓰고, 여기서는 이 페이지에만 필요한 조각(NEIS 경로 안내, 다중 과목
   학생 편집 카드, 설정 행, 과목 섹션 다운로드 버튼 등)만 보탠다.
   design-system.css·checker.css는 수정하지 않는다.
   ========================================================================== */

.page-head { padding-block: 40px 8px; }
.page-desc {
  margin-top: 10px;
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.upload-section, .settings-section, .students-section { padding-block: 20px; }

.card-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

/* ---- NEIS 경로 안내 --------------------------------------------------- */
.neis-guide {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.neis-guide__label { margin: 0 0 8px; color: var(--ink-soft); }
.neis-guide__path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  font-weight: 700;
  color: var(--ink);
}
.neis-guide__sep { color: var(--ink-soft); font-weight: 400; margin: 0 2px; }
.neis-guide__note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* ---- 업로드 존 내부 -------------------------------------------------- */
.upload-zone__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.upload-zone__hint { font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.upload-status {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  min-height: 1.4em;
}
.upload-status.ok { color: var(--hl-teal-ink); font-weight: 600; }
.upload-status.err { color: var(--hl-red-ink); font-weight: 600; }

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.upload-row label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.upload-row select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
}

/* ---- 설정 행 ----------------------------------------------------------- */
.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.settings-row__field { display: flex; align-items: center; gap: 8px; }
.settings-row__label { font-weight: 600; color: var(--ink); }
.settings-row select,
.settings-row input[type="number"] {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
}
.settings-row input[type="number"] { width: 76px; }
.settings-row__hint { color: var(--ink-soft); }

/* ---- 학생자료 섹션 헤더 -------------------------------------------------- */
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title-sm { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.students-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- 범례 --------------------------------------------------------------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* ---- 학생 편집 카드(다중 과목 entry) ------------------------------------- */
.student-edit-card { margin-bottom: 14px; }
.student-edit-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.student-edit-card__no,
.student-edit-card__name {
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 4px 2px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.student-edit-card__no { width: 64px; flex: none; }
.student-edit-card__name { flex: 1; min-width: 120px; }
.student-edit-card__no:focus, .student-edit-card__name:focus {
  outline: none;
  border-color: var(--brand);
}
.student-edit-card__remove {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.student-edit-card__remove:hover { background: var(--hl-red-bg); color: var(--hl-red-ink); }

.entry-row { padding-top: 12px; border-top: 1px dashed var(--line); margin-top: 12px; }
.entry-row:first-of-type { border-top: none; margin-top: 0; }
.entry-row__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.entry-row__subject {
  flex: 1;
  min-width: 100px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.entry-row__subject:focus { outline: none; border-color: var(--brand); }
.entry-row__remove {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-soft);
}
.entry-row__remove:hover { background: var(--hl-red-bg); color: var(--hl-red-ink); }

.student-edit-card textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
}
.student-edit-card textarea:focus { outline: none; border-color: var(--brand); }

.entry-row__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.entry-row__meta .gauge { flex: 1; }
.entry-row__count {
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.entry-row__count.over { color: var(--hl-red-ink); font-weight: 700; }

.entry-add-btn { margin-top: 12px; }

/* ---- 결과 영역 ------------------------------------------------------------ */
.results-section { padding-block: 8px 40px; }
.results-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px 4px;
}
.issue-clean { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--hl-teal-ink); }

.subject-section-header__actions { display: flex; align-items: center; gap: 8px; }

.student-view-block { margin-bottom: 22px; }
.student-view-block__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.student-view-block__head h3 { font-size: 17px; font-weight: 800; color: var(--ink); }
.student-view-block__subjects { display: flex; flex-direction: column; gap: 14px; }
.student-view-block__subject-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-deep);
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .settings-row { padding: 14px 16px; }
  .students-actions .btn { flex: 1 1 auto; }
  .results-controls { align-items: stretch; }
}

/* ---- hidden 속성 방어 --------------------------------------------------
   design-system.css의 .empty-state와 이 파일의 .results-controls/.upload-row는
   display를 무조건 지정한다. 브라우저 기본 [hidden] 규칙은 UA 오리진이라 author
   규칙(같은 요소에 display를 지정하는 클래스)에 밀려 무시된다 — 그러면 JS로
   .hidden = true를 켜도 실제로는 안 사라진다. 동적으로 hidden을 토글하는 요소는
   여기서 ID 선택자로 명시적으로 되돌린다(design-system.css·checker.css는 수정 금지). */
#resultsControls[hidden],
#emptyState[hidden],
#sheetRow[hidden],
#actionBar[hidden] {
  display: none !important;
}
