/* viz.css — 대시보드의 그림들.
 *
 * ══ 색을 눈으로 고르지 않았습니다 ═════════════════════════════════
 *
 * 보라 오르막  #b8aaef → #453596
 *   밝기가 한 방향으로만 오르고, 칸 사이 간격이 다 벌어져 있으며,
 *   가장 밝은 칸도 흰 바탕에서 2.09:1 로 보입니다. 검증기로 확인한 값입니다.
 *
 * ══ 지킨 것 ══════════════════════════════════════════════════════
 *
 * · **크기는 한 색으로.** 정답률·푼수는 «누구인지»가 아니라 «얼마나»입니다.
 *   막대마다 다른 색을 칠하면 길이가 이미 말하는 것을 색으로 또 말하는 것이고,
 *   그러면 정작 무엇이 큰지가 묻힙니다.
 * · **격자와 축은 물러납니다.** 데이터가 가장 진해야 합니다.
 * · **값은 막대 끝에 바로 적습니다.** 눈금자를 따라가게 하지 않습니다.
 * · **상태는 색만으로 나르지 않습니다.** 기호(● ▲ ■)와 말이 늘 함께 갑니다.
 * · **혼내는 붉은색을 아이 화면에 쓰지 않습니다.** 못 채운 날은 회색입니다.
 */

.board { padding-bottom: 40px; }
.viz-loading { color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center; }
.viz-empty { color: var(--soft-muted); font-size: 13.5px; padding: 14px 0; }
.viz-empty-big { background: var(--surface); border: 1px dashed var(--line); border-radius: 20px;
  padding: 56px 24px; text-align: center; }
.viz-empty-big strong { display: block; font-size: 16px; margin-bottom: 7px; }
.viz-empty-big span { color: var(--muted); font-size: 13.5px; }

/* ── 타일 ── 한 개의 수는 그래프가 아닙니다 */
.viz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 0 0 16px; }
.viz-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 17px 18px; }
.viz-tile dt { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: -.01em; }
.viz-tile dd { margin: 6px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.viz-tile dd small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.viz-tile p { margin: 5px 0 0; font-size: 11.5px; color: var(--soft-muted); font-weight: 600; }

/* ── 카드 ── */
.viz-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 20px 22px; margin-bottom: 14px; }
.viz-card h3 { font-size: 15.5px; margin: 0 0 4px; letter-spacing: -.01em; }
.viz-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.viz-sub strong { color: var(--ink); }
.viz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.viz-two > .viz-card { margin-bottom: 14px; }

/* ── 가로 막대 ── 이름이 길어서 눕힙니다. 값은 끝에 바로 적습니다 */
.viz-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.viz-bars li { display: grid; grid-template-columns: minmax(120px, 1.4fr) 2fr auto;
  align-items: center; gap: 12px; }
.viz-bar-name { font-size: 13px; font-weight: 700; line-height: 1.4; }
.viz-bar-name small { display: block; font-size: 11px; font-weight: 600; color: var(--soft-muted); margin-top: 2px; }
.viz-bar-track { height: 11px; background: #f2f4f6; border-radius: 99px; overflow: hidden; }
.viz-bar-track i { display: block; height: 100%; border-radius: 99px; transition: width .3s ease-out; }
.viz-bar-value { font-size: 13px; font-weight: 800; color: var(--ink); min-width: 42px; text-align: right; }

/* ── 미터 ── 표 한 칸에 들어가는 비율 */
.viz-meter { display: flex; align-items: center; gap: 9px; min-width: 96px; }
.viz-meter i { flex: none; height: 7px; border-radius: 99px; min-width: 2px; }
.viz-meter::before { content: ""; position: absolute; }
.viz-meter b { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.viz-meter.없음 { color: var(--soft-muted); font-weight: 700; font-size: 12.5px; }
/* 트랙을 깔아 «얼마 남았나»가 보이게 합니다 */
td .viz-meter { position: relative; padding: 4px 0; }
td .viz-meter i { box-shadow: 0 0 0 0 transparent; }

/* ── 이레 막대 ── 못 채운 날을 붉게 하지 않습니다 */
.viz-week { display: flex; align-items: flex-end; gap: 7px; height: var(--h, 46px); }
.viz-week-day { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; gap: 6px; }
.viz-week-day i { display: block; width: 100%; max-width: 34px; border-radius: 5px 5px 2px 2px; }
.viz-week-day small { font-size: 10.5px; font-weight: 700; color: var(--soft-muted); }
.viz-week-day.오늘 small { color: var(--accent-dark); }

/* ── 상태 칩 ── 색만으로 뜻을 나르지 않습니다 */
.viz-chip { display: inline-flex; align-items: center; gap: 6px; margin: 4px 6px 0 0;
  padding: 4px 10px 4px 8px; border-radius: 99px; background: var(--cream);
  font-size: 11.5px; font-weight: 700; color: var(--ink); }
.viz-chip b { font-size: 9px; line-height: 1; }

.viz-need { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.viz-need button { width: 100%; text-align: left; background: var(--cream); border: 0;
  border-radius: 13px; padding: 12px 14px; font: inherit; cursor: pointer; }
.viz-need button:hover { background: #eef0f4; }
.viz-need strong { display: block; font-size: 13.5px; margin-bottom: 2px; }

/* ── 표 ── 일곱 갈래가 넘으면 색이 아니라 표입니다 */
.viz-table-wrap { overflow-x: auto; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.viz-table th { text-align: left; font-size: 11px; font-weight: 800; color: var(--muted);
  padding: 0 12px 9px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.viz-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.viz-table tr:last-child td { border-bottom: 0; }
.viz-table .수 { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-table th.수 { text-align: right; }
.viz-table .흐림 { color: var(--soft-muted); font-size: 12px; white-space: nowrap; }
.viz-table tr:hover { background: var(--cream); }
.viz-name { background: none; border: 0; font: inherit; font-weight: 700;
  color: var(--accent-dark); cursor: pointer; padding: 0; }
.viz-name:hover { text-decoration: underline; }

/* ── 필기 ── 「왜 틀렸나」는 풀이를 봐야 압니다 */
.viz-inks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.viz-ink-card { margin: 0; background: var(--cream); border-radius: 14px; padding: 13px; }
.viz-ink-card figcaption { margin-bottom: 9px; }
.viz-ink-card figcaption strong { display: block; font-size: 12.5px; }
.viz-ink-card figcaption small { display: block; font-size: 11px; color: var(--soft-muted);
  font-weight: 600; margin-top: 2px; line-height: 1.5; }
.viz-ink { display: block; width: 100%; height: auto; background: #fffefa;
  border: 1px solid var(--line); border-radius: 9px; }

/* ── 명단/대시보드 탭 ── */
.class-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.class-tab { background: none; border: 0; border-radius: 11px; padding: 9px 16px;
  font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.class-tab:hover { color: var(--ink); }
.class-tab.on { background: var(--accent); color: #fff; }

@media (max-width: 760px) {
  .viz-two { grid-template-columns: 1fr; }
  .viz-bars li { grid-template-columns: 1fr auto; }
  .viz-bar-track { grid-column: 1 / -1; }
  .viz-inks { grid-template-columns: 1fr; }
}

/* ── 날짜 줄 (기간을 고를 수 있는 것) ────────────────────────────── */
.viz-days { display: flex; align-items: flex-end; gap: 3px; height: var(--h, 76px); }
.viz-day { flex: 1; min-width: 4px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.viz-day i { display: block; width: 100%; max-width: 26px; border-radius: 4px 4px 2px 2px; }
.viz-day small { font-size: 9.5px; font-weight: 700; color: var(--soft-muted);
  white-space: nowrap; min-height: 12px; }
.viz-day.오늘 small { color: var(--accent-dark); }

/* ── 견줌 막대 — 옅은 것이 푼 수, 진한 것이 맞힌 수 ─────────────── */
.viz-bars.견줌 .viz-bar-track { position: relative; }
.viz-bars.견줌 .viz-bar-track i { position: absolute; left: 0; top: 0; }
.viz-bars.견줌 .푼것 { background: #e7e3f7; }
.viz-bars.견줌 .맞힌것 { z-index: 1; }
.viz-bar-value small { font-weight: 600; color: var(--soft-muted); font-size: 11.5px; }

.viz-legend { display: flex; gap: 16px; margin: 0 0 14px; font-size: 11.5px;
  font-weight: 700; color: var(--muted); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 13px; height: 9px; border-radius: 3px; }
.viz-legend .푼것 { background: #e7e3f7; }
.viz-legend .맞힌것 { background: #7d6adb; }

@media (max-width: 620px) {
  .viz-head { flex-direction: column; }
  .viz-range { width: 100%; }
  .viz-range-btn { flex: 1; text-align: center; }
}

/* ── 달력 히트맵 ─────────────────────────────────────────────────────
 *
 * 막대로는 안 됩니다 — 며칠 하고 며칠 쉰 자료는 화면 대부분이 빈 바닥이고
 * 막대 하나만 우뚝 섭니다. 격자는 **한 칸이 하루**라 며칠 쉬었는지가 그대로 보이고,
 * 줄이 요일이라 **무슨 요일에 하는지**까지 보입니다. 세로 자리도 거의 안 먹습니다. */

.viz-cal { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.viz-cal-days { display: flex; flex-direction: column; gap: 3px; padding-top: 17px; flex: none; }
.viz-cal-days span { font-size: 9.5px; color: var(--soft-muted); font-weight: 700; width: 14px; text-align: right; }
.viz-cal-plot { position: relative; overflow-x: auto; padding-top: 17px; flex: 1; min-width: 0; }
.viz-cal-months { position: absolute; top: 0; left: 0; height: 15px; }
.viz-cal-months span { position: absolute; font-size: 10px; font-weight: 700; color: var(--soft-muted); white-space: nowrap; }
.viz-cal svg { display: block; }
.viz-cal-key { display: flex; align-items: center; gap: 4px; margin-left: auto; padding-top: 17px; flex: none; }
.viz-cal-key span { font-size: 10px; color: var(--soft-muted); font-weight: 700; }
.viz-cal-key i { width: 11px; height: 11px; border-radius: 3px; }

/* ── 대시보드 안의 탭 ─────────────────────────────────────────────
 *
 * 한 화면에 다 담으면 스크롤이 너무 깁니다. **다 못 담으면 나눕니다.** */
.board-tabs { display: flex; gap: 4px; background: var(--cream); border-radius: 13px;
  padding: 4px; margin-bottom: 16px; overflow-x: auto; }
.board-tab { flex: 1; background: none; border: 0; border-radius: 10px; padding: 10px 14px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--muted);
  cursor: pointer; white-space: nowrap; }
.board-tab:hover { color: var(--ink); }
.board-tab.on { background: var(--surface); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,.07); }

/* ══ 분석 ═══════════════════════════════════════════════════════════
 *
 * **선생님이 고쳐 쓸 초안**입니다. 그래서 「그대로 옮기지 마세요」를 늘 답니다.
 *
 * 마크다운을 그리지 않습니다 — 모델에게 **칸을 정해 주고 그 칸만 채우게** 했으므로
 * 여기서는 칸을 꺼내 놓기만 합니다. 모델이 제 작업 메모를 뱉어도 칸 밖이라 안 들어옵니다. */

.분석 { background: var(--surface); border: 1px solid #e2dcf8; border-radius: 22px;
  padding: 26px 26px 22px; margin: 20px 0 40px;
  box-shadow: 0 24px 60px rgba(105, 88, 217, .07); }
.분석-머리 { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.분석-머리 h3 { font-size: 17px; margin: 0; }
.분석-때 { margin: 4px 0 0; font-size: 11.5px; color: var(--soft-muted); font-weight: 600; }

.분석-몸 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.분석-덩이 { background: var(--cream); border-radius: 16px; padding: 18px 20px; }
.분석-덩이.넓게 { grid-column: 1 / -1; }
.분석-덩이 h4 { margin: 0 0 10px; font-size: 12px; font-weight: 800; color: var(--accent-dark);
  text-transform: uppercase; letter-spacing: .07em; }
.분석-큰글 { margin: 0; font-size: 15.5px; line-height: 1.9; }

.분석-목록 { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.분석-목록 li { display: grid; gap: 3px; }
.분석-목록 strong { font-size: 14px; }
.분석-목록 span { font-size: 13px; color: var(--muted); line-height: 1.7; }
.분석-목록.아이들 strong { color: var(--accent-dark); }

.분석-결 { justify-self: start; font-style: normal; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 99px; margin: 2px 0; }
.분석-결.모두 { background: #e4f4ee; color: #1f7d5e; }
.분석-결.몇명 { background: #fdf0ed; color: #b8503f; }

.분석-걸음 { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; counter-reset: 걸음; }
.분석-걸음 li { display: flex; gap: 12px; align-items: flex-start; }
.분석-걸음 b { flex: none; width: 23px; height: 23px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; margin-top: 1px; }
.분석-걸음 strong { display: block; font-size: 14px; }
.분석-걸음 span { display: block; font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 2px; }

.분석-덩이.초안 { background: #f6f3ff; border: 1px solid #e2dcf8; }
.분석-초안글 { margin: 0; font-size: 15px; line-height: 2; font-family: "Gowun Dodum", serif; }
.분석-초안발 { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.분석-초안발 strong { color: var(--warn); }

.분석-곁 { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); line-height: 1.75; }
.분석-발 { margin: 20px 0 0; padding-top: 15px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--soft-muted); line-height: 1.8; }
.분석-발 strong { color: var(--muted); }
.분석-지난 { margin: 14px 0 0; font-size: 11.5px; color: var(--soft-muted); }

@media (max-width: 760px) { .분석-몸 { grid-template-columns: 1fr; } }

/* ══ 점 그래프 ══════════════════════════════════════════════════════
 *
 * 막대 스물다섯 개로는 「우리 반이 어떻게 퍼져 있나」가 안 보입니다.
 * 점 하나가 한 아이고, 겹치면 위로 쌓여 **몇 명인지**가 보입니다. */

.viz-dots { --판: 132px; }
.viz-dots-plot { position: relative; height: var(--판); margin: 4px 10px 0; }
.viz-dots-grid { position: absolute; top: 0; bottom: 18px; width: 1px;
  background: var(--line); transform: translateX(-.5px); }
.viz-dots-mean { position: absolute; top: 0; bottom: 18px; width: 2px;
  background: var(--accent); opacity: .5; transform: translateX(-1px); border-radius: 2px; }
.viz-dots-mean-label { position: absolute; top: -2px; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 800; color: var(--accent-dark); white-space: nowrap; }
.viz-dot { position: absolute; border-radius: 99px; background: #6250d0;
  transform: translateX(-50%); box-shadow: 0 0 0 2px var(--surface); transition: transform .12s; }
.viz-dot:hover { transform: translateX(-50%) scale(1.35); z-index: 2; }
/* 짚어 볼 아이만 도드라지게 — 나머지는 물러납니다 */
.viz-dots-plot:has(.도드라짐) .viz-dot:not(.도드라짐) { background: #c9ced3; }
.viz-dot.도드라짐 { background: #453596; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #ded8f7; }
.viz-dots-axis { position: relative; height: 16px; margin: 0 10px; }
.viz-dots-axis span { position: absolute; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; color: var(--soft-muted); }

/* ══ 격자 ═══════════════════════════════════════════════════════════
 *
 * 「누가 무엇에 약한가」는 이것 말고는 한 화면에 안 들어갑니다.
 * 세로로 훑으면 「반이 다 약한 것」, 가로로 훑으면 「처진 아이」가 보입니다. */

.viz-grid-wrap { overflow-x: auto; }
.viz-grid { border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.viz-grid thead th { font-weight: 700; color: var(--soft-muted); vertical-align: bottom;
  padding: 0 0 5px; height: 62px; }
.viz-grid thead th span { display: block; writing-mode: vertical-rl; transform: rotate(180deg);
  white-space: nowrap; max-height: 58px; overflow: hidden; margin: 0 auto; }
.viz-grid-corner { min-width: 74px; }
.viz-grid-name { text-align: left; font-weight: 700; font-size: 12px; color: var(--ink);
  white-space: nowrap; padding-right: 8px; }
.viz-grid-cell { width: 21px; height: 21px; border-radius: 5px; padding: 0; }
.viz-grid-cell.빔 { background: repeating-linear-gradient(45deg,
  #f4f6f8 0 3px, #eaeef1 3px 6px); }
.viz-grid tbody tr[data-student] { cursor: pointer; }
.viz-grid tbody tr[data-student]:hover .viz-grid-name { color: var(--accent-dark); text-decoration: underline; }
.viz-cal-key i.빔 { background: repeating-linear-gradient(45deg,
  #f4f6f8 0 3px, #eaeef1 3px 6px); margin-left: 8px; }

/* ══ 고리 ═══════════════════════════════════════════════════════════
 *
 * 파이가 아닙니다 — 조각을 견주는 것이 아니라 「얼마나 찼나」 하나를 봅니다.
 * 가운데 수가 주인공입니다. */

.viz-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 12px; }
.viz-ring { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.viz-ring figcaption { text-align: center; }
.viz-ring figcaption strong { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.viz-ring figcaption small { display: block; font-size: 11px; color: var(--soft-muted);
  font-weight: 600; margin-top: 2px; }

/* ══ 지금 하고 있는 아이 ═════════════════════════════════════════════
 *
 * **선생님이 교실에서 가장 먼저 보고 싶은 것**입니다.
 * 깃발을 서버에 두지 않고 「얼마나 최근에 움직였나」로 봅니다 — 덮어 두면 저절로 식습니다. */

.지금판 h3 { display: flex; align-items: center; gap: 9px; }
.숨쉼 { width: 9px; height: 9px; border-radius: 99px; background: var(--mint); flex: none;
  animation: 숨쉬기 2.4s ease-in-out infinite; }
@keyframes 숨쉬기 {
  0%, 100% { box-shadow: 0 0 0 0 rgba(115, 216, 189, .55); }
  60% { box-shadow: 0 0 0 7px rgba(115, 216, 189, 0); }
}
@media (prefers-reduced-motion: reduce) { .숨쉼 { animation: none; } }

.지금목록 { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.지금목록 li { padding: 10px 12px; border-radius: 13px; background: var(--cream);
  border: 1px solid transparent; cursor: pointer; transition: transform .12s; }
.지금목록 li:hover { transform: translateY(-1px); }
.지금목록 b { display: block; font-size: 13px; font-weight: 700; }
.지금목록 small { display: block; font-size: 11px; color: var(--soft-muted); margin-top: 2px; }
/* 하는 중인 아이만 도드라집니다 — 나머지는 물러납니다 */
.지금목록 li.하는중 { background: #e8f8f2; border-color: #b6e6d5; }
.지금목록 li.하는중 b { color: #1f7d5e; }
.지금목록 li.하는중 small { color: #2f9271; font-weight: 700; }
.지금목록 li.아직 { opacity: .55; }
