/* staff 화면 전용 (토스 규칙 적용, 2026-11-26). 공용 부품은 style.css */

/* 선생님·조교 화면: 매일 쓰는 화면이라 폭을 넓게, 표는 카드 폭을 채운다 */
.is-staff .container { max-width: 1160px; }
.is-staff main .table-wrap > table, .is-staff main .card > table { width: 100%; }

/* 휴대폰: 표를 옆으로 구겨 넣지 않고 한 줄씩 묶음으로 (제목 한 줄, 아래에 이름표와 값) */
@media (max-width: 720px) {
  main table.rowcards, main table.rowcards tbody { display: block; width: 100%; }
  main table.rowcards thead, main table.rowcards tr.rc-head { display: none; }
  main table.rowcards tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); background: none; }
  main table.rowcards tr:last-child { border-bottom: 0; }
  main table.rowcards td { display: inline-flex; align-items: baseline; gap: 6px; width: auto; padding: 0; border: 0; text-align: left; font-size: 14px; white-space: normal; background: none; }
  main table.rowcards td::before { content: attr(data-th); color: var(--muted); font-size: 12.5px; font-weight: 400; white-space: nowrap; }
  main table.rowcards td.rc-title { order: -2; flex: 1 1 100%; font-size: 16px; font-weight: 700; }
  main table.rowcards td.rc-title a { color: var(--ink); }
  main table.rowcards td.rc-title::before, main table.rowcards td.rc-tag::before, main table.rowcards td[data-th=""]::before { content: none; }
  main table.rowcards td.rc-none { display: none; }
  main .table-wrap:has(> table.rowcards) { overflow: visible; }
}

/* 질문답변 목록: 휴대폰에서 상태 배지는 늘 제목 줄 오른쪽 끝 (학생 이름과 반 길이에 따라 자리가 바뀌지 않게) */
@media (max-width: 720px) {
  main table.rowcards.q-table td.rc-title { flex: 1 1 calc(100% - 96px); display: block; text-align: left; }
  main table.rowcards.q-table td.rc-tag { order: -1; margin-left: auto; align-self: flex-start; }
}

/* 고르는 칩이 여러 줄일 때: 한 줄로 접어 두고, 고른 값은 접힌 채로 보여 준다 */
.filter-fold { margin: 4px 0 12px; }
.filter-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; margin: 0; border-radius: 12px; background: var(--sheet); color: var(--ink); font-size: 14px; }
.filter-fold > summary::-webkit-details-marker { display: none; }
.filter-fold > summary b { font-weight: 700; }
.filter-fold > summary > span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-fold > summary em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--danger); white-space: nowrap; }
.filter-fold > summary::after { content: ""; flex: none; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.filter-fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.filter-fold[open] > summary { margin-bottom: 10px; }
.filter-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .filter-fold > summary::after { transition: none; } }

/* 질문과 첨삭: 세 목록을 오가는 칩 줄 */
.inbox-tabs { margin: 0 0 14px; }
/* 짧은 줄 목록 (수업 칸의 수업 기록 등): 왼쪽 제목, 오른쪽 흐린 값 */
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list li > span { white-space: nowrap; }

/* 이름표와 값 줄 (학생 기본 정보 등): 이름표는 왼쪽 흐리게, 값은 오른쪽 */
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.kv dd { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.plink { overflow-wrap: anywhere; }
.row.nowrap { flex-wrap: nowrap; align-items: center; }
main .row.nowrap > input.num-in { width: 6.5em; min-width: 0; flex: 0 0 6.5em; text-align: center; }
@media (max-width: 720px) {
  main table.rowcards td.rc-wide { flex: 1 1 100%; display: block; }
  main table.rowcards td.rc-wide::before { display: block; margin-bottom: 2px; }
  main table.rowcards td.rc-title.rc-wide { font-size: 15px; }
  /* 입력칸은 한 줄에 하나, 숫자 칸과 버튼 줄은 넘치면 다음 줄로 */
  main .row > .field:not(.shrink) { flex: 1 1 100%; min-width: 0; }
  main .row.nowrap { flex-wrap: wrap; }
}

/* 처리 화면(질문 답변, 복습 테스트 첨삭, 모의고사 피드백). 데스크톱은 왼쪽에 자료, 오른쪽에 입력.
   휴대폰은 사진이 머리줄 아래에 붙어 있고(옆으로 넘김, 누르면 크게) 그 아래로 입력이 흐른다: 키보드를 열어도 사진과 입력칸이 함께 보인다. */
.work { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.work-ref { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; display: grid; gap: 12px; }
.work-photos { display: grid; gap: 10px; }
.work-photos a { display: block; }
.work-photos img { display: block; width: 100%; border-radius: 12px; background: var(--raised); }
.work-do { display: grid; gap: 14px; min-width: 0; }
.work-do > * { margin: 0; }
@media (max-width: 900px) {
  .work { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .work-ref { display: contents; }
  .work-photos { position: sticky; top: 52px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: -16px; padding: 8px 16px; background: var(--frame); -webkit-overflow-scrolling: touch; }
  .work-photos a { flex: 0 0 auto; scroll-snap-align: center; }
  .work-photos img { width: auto; height: min(32vh, 260px); max-width: 84vw; object-fit: contain; }
  .work-do .btn.primary { width: 100%; min-height: 52px; }
  /* 채점표: 문항마다 한 묶음 (번호와 답, 오답 유형, 메모) */
  .work .mark-table thead { display: none; }
  .work .mark-table, .work .mark-table tbody { display: block; }
  .work .mark-table tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .work .mark-table td { padding: 0; border: 0; }
  .work .mark-table td:last-child { grid-column: 1 / -1; }
  .work .mark-table :is(input[type=text], select) { font-size: 16px; min-height: 44px; }
}
.work .mark-table select { min-width: 112px; }

/* 회차 화면: 탭의 숫자(확인할 누락 학생 수), 고르는 목록 */
.chip-links .tag-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; }
.pick-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0 16px; }
.pick-list label { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.pick-list input { width: 18px; height: 18px; flex: none; }

/* 진도 일정표의 휴대폰 배치: 주차마다 카드, 이번 주만 펼침, 교재는 주차에 한 번 */
.sched-m { display: none; }
@media (max-width: 720px) {
  .sched-wrap { display: none; }
  .sched-m { display: grid; gap: 10px; }
  .sm-week { margin: 0; padding: 0 16px; }
  .sm-week > summary { list-style: none; cursor: pointer; display: grid; gap: 6px; padding: 14px 0; }
  .sm-week > summary::-webkit-details-marker { display: none; }
  .sm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .sm-head b { font-size: 16px; color: var(--ink); }
  .sm-head::after { content: "›"; margin-left: auto; color: var(--faint); font-size: 20px; transform: rotate(90deg); }
  .sm-week[open] .sm-head::after { transform: rotate(-90deg); }
  .sm-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12.5px; color: var(--muted); }
  .sm-sum span { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
  .sm-sum b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
  .sm-week[open] > summary .sm-sum { display: none; }
  .sm-week.is-now { box-shadow: inset 3px 0 0 var(--accent); }
  .sm-week.is-off > summary { color: var(--muted); }
  .sm-topic { margin: 0 0 4px; font-weight: 600; }
  .sm-week .list-rows { margin: 8px 0; }
  .sm-week .lr-end { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .sm-h { margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 4px; }
  .sm-tot { padding: 10px 0 14px; border-top: 1px solid var(--rule); }
  .sm-tot > summary { cursor: pointer; color: var(--muted); }
  .sm-tot div { padding: 3px 0; }
}

/* 3차 토론: 학생이 물은 글이 사진보다 먼저. 사진이 한 장이면 가운데에 */
.work-ask { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--sheet); font-weight: 600; line-height: 1.55; word-break: keep-all; }
.work-ask small { display: block; font-weight: 400; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 900px) { .work-photos a:only-child { margin-inline: auto; } .work-photos a:only-child img { max-width: 100%; } }
/* 누락 학생: 반별 묶음, 처리 버튼은 화면 아래에 붙는다 */
.pick-group { margin: 12px 0 0; }
main fieldset.pick-group { background: none; padding: 0; }
.pick-group > legend label { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.pick-group > legend input, .pick-list input { width: 18px; height: 18px; flex: none; }
.pick-group .pick-list { margin-top: 0; padding-left: 26px; }
.pick-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 10px 0; background: var(--sheet); border-top: 1px solid var(--rule); z-index: 4; }
@media (max-width: 900px) { .pick-bar { bottom: calc(64px + env(safe-area-inset-bottom)); } .pick-bar .btn { flex: 1 1 auto; min-height: 48px; } }

/* 출석부 (4차 토론): 이름과 아이디 한 줄, 출석 지각 조퇴 결석은 바로 누르고 다른 반과 미체크는 기타 안 */
.att-rows { list-style: none; margin: 12px 0; padding: 0; }
.att-rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ar-name { min-width: 0; }
.ar-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ar-opt { position: relative; display: inline-flex; cursor: pointer; }
.ar-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ar-opt span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 40px; padding: 0 10px; border-radius: 10px; background: var(--raised); color: var(--muted); font-weight: 600; font-size: 14px; }
.ar-opt input:checked + span { background: var(--accent); color: var(--on-accent, #fff); }
.ar-opt.ar-2 input:checked + span, .ar-opt.ar-3 input:checked + span, .ar-opt.ar-4 input:checked + span { background: var(--danger); }
.ar-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ar-more { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ar-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--raised); color: var(--muted); font-weight: 600; font-size: 14px; }
.ar-more > summary::-webkit-details-marker { display: none; }
.ar-more:has(input[value="다른 반"]:checked) > summary { background: var(--accent-soft); color: var(--accent-ink); }
.ar-more:has(input[value="다른 반"]:checked) > summary::after { content: ": 다른 반"; }
@media (max-width: 560px) { .att-rows li { align-items: flex-start; flex-direction: column; } .ar-pick { width: 100%; } .ar-opt { flex: 1 1 0; } .ar-opt span { width: 100%; min-width: 0; min-height: 44px; } .ar-more .ar-opt { flex: 0 0 auto; } }

/* 첨삭: 사진 크게 보기를 켜면 붙어 있는 사진 줄이 화면 위쪽 절반을 넘게 커진다 */
.ph-big-btn { justify-self: start; }
.ph-big-toggle:checked + .ph-big-btn { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 900px) { .work:has(.ph-big-toggle:checked) .work-photos img { height: min(58vh, 520px); max-width: none; } }
@media (min-width: 901px) { .ph-big-btn { display: none; } }
/* 조교 받은 일 화면(질문, 첨삭, 피드백): 휴대폰에서는 탭이 제목 노릇을 하므로 제목 줄을 감춘다 */
@media (max-width: 720px) { .inbox-tabs ~ :is(header.ed-head, .page-head) h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .inbox-tabs ~ header.ed-head { margin: 0; } }
@media (max-width: 560px) { .ar-more > summary { min-height: 44px; } }
.att-rows .ar-opt, .att-rows .ar-more > summary { margin: 0; }
