@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #3b5bdb;
  --brand-ink: #2f44b3;
  --hero-1: #2b3784;
  --hero-2: #3a4aa6;
  --good: #0f9d58;
  --bad: #d93025;
  --warn-bg: #fff7e6;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar .brand-logo { height: 28px; width: auto; vertical-align: -6px; margin-right: 10px; }
.topbar .brand { font-weight: 800; font-size: 19px; letter-spacing: -.02em; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { font-weight: 700; white-space: nowrap; }
.topbar .who span { font-weight: 400; color: var(--muted); }

/* ---------- 버튼 · 입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid #d1d5db; border-radius: 12px;
  background: #fff; cursor: pointer; white-space: nowrap;
  font-weight: 600; font-size: 15px;
}
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label.field > small { display: block; font-size: 12.5px; margin-top: 5px; }
div.field { margin-bottom: 14px; }
.flabel { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=url], input[type=password], input[type=email], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 12px; background: #fff;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- 레이아웃 ---------- */
.page { max-width: 960px; margin: 0 auto; padding: 28px 20px 120px; }
.eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .14em; font-size: 13px; text-transform: uppercase; }
h1.title { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 24px; }
h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 14px; }
h3 { font-size: 17px; margin: 0 0 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid2 > *, .grid3 > * { margin-top: 0 !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.hero {
  border-radius: 24px; padding: 40px 28px; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  color: #fff; box-shadow: 0 14px 30px rgba(43, 55, 132, .25);
}
.hero .sub { opacity: .8; font-size: 15px; }
.hero .motto { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.hero .hero-cmt { font-size: 17px; font-weight: 600; line-height: 1.6; margin-top: 10px; max-width: 560px; word-break: keep-all; }
.hero-logo { height: 30px; width: auto; display: block; margin-bottom: 14px; opacity: .95; }
.page-head { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
  border-radius: 20px; padding: 24px 26px; margin-bottom: 20px; color: #fff;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); box-shadow: 0 10px 24px rgba(43, 55, 132, .18); }
.page-head .eyebrow { color: rgba(255, 255, 255, .75); }
.page-head h1 { margin: 4px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.page-head-logo { height: 92px; width: auto; margin: -18px -6px -26px 0; opacity: .22; }
.clinic-card { display: flex; gap: 14px; align-items: flex-start; }
.clinic-card .k { color: var(--muted); font-weight: 600; }
.clinic-card .clinic-v { font-size: 19px; font-weight: 700; margin-top: 4px; white-space: pre-line; letter-spacing: -.01em; }
.clinic-ic { font-size: 26px; width: 48px; height: 48px; border-radius: 14px; background: #eef2ff; display: grid; place-items: center; flex: none; }
.material { display: flex; align-items: center; gap: 12px; }
.material-main { flex: 1; min-width: 0; }
.material .meta { overflow-wrap: anywhere; }
.file-ic { font-size: 24px; width: 44px; height: 44px; border-radius: 12px; background: #f3f4f6; display: grid; place-items: center; flex: none; }
.class-filter { width: auto; min-width: 150px; min-height: 40px; padding: 6px 12px; font-weight: 600; }
tr.off-class, tr.off-search { display: none; }
.answer-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.answer-who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: center 15%; }
.cmt-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: #eef2ff; }
.cmt-note img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 15%; flex: none; }
.cmt-note .k { font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.cmt-note p { margin: 4px 0 0; line-height: 1.65; word-break: keep-all; }
.hero .teacher { margin-top: 14px; font-size: 14px; font-weight: 600; opacity: .85; }
.hero.has-photo { position: relative; overflow: hidden; display: flex; align-items: stretch; padding: 0; min-height: 200px; }
.hero.has-photo .hero-text { flex: 1; padding: 40px 0 36px 28px; align-self: center; position: relative; z-index: 1; }
.hero-photo { width: 190px; flex: none; object-fit: cover; object-position: center 18%; align-self: stretch;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 38%); mask-image: linear-gradient(to right, transparent 0, #000 38%); }
.login .card.login-card { padding: 0; overflow: hidden; max-width: 420px; }
.login-banner { display: flex; min-height: 170px; background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); color: #fff; }
.login-banner-text { flex: 1; padding: 26px 0 22px 24px; display: flex; flex-direction: column; justify-content: flex-end; }
.login-logo { height: 34px; width: auto; align-self: flex-start; margin-bottom: auto; }
.login-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 18px; line-height: 1.3; }
.login-sub { font-size: 13px; opacity: .8; margin-top: 4px; }
.login-banner .hero-photo { width: 150px; }
.login-body { padding: 26px 24px 28px; }

.tile { display: block; color: inherit; min-height: 150px; }
.tile .k { color: var(--muted); font-weight: 600; }
.tile .v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 6px; line-height: 1.25; }
.tile .v.link { color: var(--brand); }
.tile .d { color: #9ca3af; font-size: 15px; }

.stat { background: #f8f9fc; border-radius: 14px; padding: 14px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 800; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--muted); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #eef2ff; color: var(--brand-ink); }
.pill.gray { background: #f3f4f6; color: var(--muted); }
.pill.good { background: #e6f4ea; color: #137333; }
.pill.bad { background: #fce8e6; color: #b3261e; }
.pill.warn { background: var(--warn-bg); color: #8a5a00; }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { white-space: nowrap; text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td input, td select { min-height: 38px; padding: 6px 8px; border-radius: 10px; }

/* ---------- 목록 ---------- */
.list-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { font-size: 13px; color: var(--muted); }
.list-item .body { white-space: pre-wrap; margin-top: 8px; color: var(--ink-2); }
.answer { margin-top: 10px; padding: 12px 14px; background: #f5f7ff; border-radius: 12px; white-space: pre-wrap; }

/* ---------- 하단 탭 (학생) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tabbar a .ic { font-size: 22px; line-height: 1.2; }
.tabbar a.on { color: var(--brand); }

/* ---------- 관리자 탭 ---------- */
.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 61px; z-index: 15; }
.admin-nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; white-space: nowrap; font-size: 15px; }
.admin-nav a.on { background: #eef2ff; color: var(--brand-ink); }
.admin-nav .badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 400px; padding: 32px 26px; }
.login h1 { font-size: 24px; margin: 6px 0 22px; letter-spacing: -.02em; }
.error-text { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- 리포트 카드 ---------- */
.msg { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; }
.msg + .msg { margin-top: 12px; }
.msg textarea { font-size: 14px; min-height: 260px; margin-top: 10px; background: #fbfbfd; }
.msg .cmt-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #eef2ff; }
.msg textarea.cmt { min-height: 0; margin-top: 8px; background: #fff; font-size: 14px; }
.msg.off { opacity: .55; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; margin-top: 12px; z-index: 5; }

/* ---------- 차트 ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; align-items: center; }
.legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.sw-me { background: var(--brand); }
.sw-avg { background: #9ca3af; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.c-grid { stroke: #eef0f4; stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 12px; }
.c-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.c-line.c-me { stroke: var(--brand); }
.c-line.c-avg { stroke: #9ca3af; stroke-dasharray: 5 4; }
.c-dot { stroke: #fff; stroke-width: 2; }
.c-dot.c-me { fill: var(--brand); }
.c-dot.c-avg { fill: #9ca3af; }
.c-label { font-size: 13px; font-weight: 700; fill: var(--ink-2); }
.c-cross { stroke: #c7cbd4; stroke-width: 1; }
.c-tip { position: absolute; top: -6px; transform: translateY(-100%); background: #111827; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; pointer-events: none; white-space: nowrap; line-height: 1.5; }

/* ---------- 모달 · 토스트 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; padding: 24px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: #111827; color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; transition: .2s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); }

.empty { text-align: center; color: var(--muted); padding: 36px 0; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 110px; }
  .topbar { padding: 12px 16px; }
  .topbar .brand { font-size: 16px; }
  .topbar .brand-logo { height: 24px; margin-right: 6px; }
  .topbar { gap: 8px; }
  h1.title { font-size: 26px; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .grid2 { gap: 12px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 130px; }
  .tile .v { font-size: 17px; }
  .hero { padding: 30px 22px; }
  .hero .motto { font-size: 20px; }
  .hero .hero-cmt { font-size: 15px; }
  .hero.has-photo .hero-text { padding: 28px 0 26px 22px; }
  .hero-photo { width: 128px; }
  .topbar .hide-sm { display: none; }
  .tabbar a { font-size: 11px; letter-spacing: -.03em; }
  .tabbar a .ic { font-size: 20px; }
}
details.faq summary { cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: 'Q'; display: inline-block; width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; background: #eef2ff; color: var(--brand-ink); font-weight: 800; font-size: 13px; text-align: center; line-height: 22px; }
details.faq[open] summary { margin-bottom: 8px; }

/* ---------- 클리닉 출석 (선생님) ---------- */
.clinic-count { font-size: 20px; font-weight: 800; color: var(--good); }
.clinic-search { margin-top: 12px; font-size: 18px; min-height: 52px; }
.clinic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.clinic-btn { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; transition: background .15s, border-color .15s; }
.clinic-btn:hover { border-color: var(--brand); }
.clinic-btn .nm { font-size: 17px; font-weight: 800; color: var(--ink); }
.clinic-btn .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clinic-btn .wk { font-size: 12px; color: #9ca3af; }
.clinic-btn.on { background: #e8f6ee; border-color: #8fd1ab; }
.clinic-btn.on .sub { color: var(--good); font-weight: 700; }
.clinic-btn:disabled { opacity: .6; }
select.auto { background: #e8f6ee; }

/* ---------- 이번 주 클리닉 출석 (학생·학부모) ---------- */
.cw { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.cw-day { border: 1px solid var(--line); border-radius: 12px; padding: 8px 2px; text-align: center; min-height: 74px; background: #fff; }
.cw-d { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cw-d small { display: block; font-weight: 500; color: #9ca3af; font-size: 11px; }
.cw-v { margin-top: 4px; font-size: 18px; font-weight: 800; color: var(--good); line-height: 1.1; }
.cw-v small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.cw-day.planned { border-style: dashed; border-color: #a5b4fc; }
.cw-day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cw-day.on { background: #e8f6ee; border: 1px solid #8fd1ab; }
.cw-day.on .cw-v small { color: var(--good); }
.cw-day.miss .cw-v small { color: var(--bad); }

/* ---------- 문항 분석 ---------- */
.qbars { display: flex; gap: 4px; align-items: flex-end; height: 120px; margin-top: 14px; overflow-x: auto; padding-bottom: 18px; }
.qbar { flex: 1 0 18px; height: 100%; position: relative; background: #f3f4f6; border-radius: 6px; }
.qbar .fill { position: absolute; left: 0; right: 0; bottom: 0; background: #a5b4fc; border-radius: 6px; }
.qbar.hot .fill { background: #f87171; }
.qbar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------- 보강 영상 썸네일 ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.video-grid > .card { margin-top: 0 !important; }
.video-card { padding: 0; overflow: hidden; }
.video-card.playing { grid-column: 1 / -1; }
.video-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer; position: relative;
  background: linear-gradient(135deg, var(--hero-1), #0f172a) center / cover no-repeat; }
.video-thumb .play { position: absolute; left: 50%; top: 50%; width: 60px; height: 42px; margin: -21px 0 0 -30px; border-radius: 12px; background: rgba(255, 0, 51, .92); }
.video-thumb .play::after { content: ''; position: absolute; left: 24px; top: 12px; border-left: 16px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.video-thumb .watched { position: absolute; right: 10px; top: 10px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-info { padding: 14px 16px 16px; }

/* ---------- 기타 ---------- */
.pill-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--brand-ink); }
.viewers .pill { margin: 3px 2px 0 0; }
.parent-link { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.video-thumb { background-color: #1e2a5a; }
@media (max-width: 640px) {
  .video-card:not(.playing) { display: flex; align-items: stretch; }
  .video-card:not(.playing) .video-thumb { width: 42%; flex: none; aspect-ratio: auto; min-height: 92px; }
  .video-card:not(.playing) .video-thumb .play { width: 40px; height: 28px; margin: -14px 0 0 -20px; border-radius: 8px; }
  .video-card:not(.playing) .video-thumb .play::after { left: 16px; top: 8px; border-left-width: 11px; border-top-width: 6px; border-bottom-width: 6px; }
  .video-card:not(.playing) .video-thumb .watched { right: 6px; top: 6px; font-size: 11px; padding: 2px 6px; }
  .video-info { padding: 12px 14px; }
}
.class-labels { display: grid; gap: 8px; }
.class-labels label { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 10px; }
.class-labels span { font-size: 14px; color: var(--ink-2); }
@media (max-width: 640px) { .class-labels label { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- 학생 등록: 골라서 체크 ---------- */
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chips label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; background: #fff; user-select: none; }
.pick-chips label:has(input:checked) { background: #eef2ff; border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.pick-chips input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.clinic-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.clinic-day { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.clinic-day:has(input:checked) { border-color: var(--brand); background: #eef2ff; }
.clinic-day label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; min-width: 44px; }
.clinic-day input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.clinic-day select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 14px; }
.clinic-day select:disabled { opacity: .4; }
.acct { background: #f8fafc; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }

/* ---------- 학생별 전체 기록 ---------- */
.tl-day { font-weight: 700; font-size: 14px; color: var(--ink-2); padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.tl-day:first-child { padding-top: 0; }
.tl-item { display: grid; grid-template-columns: 48px auto 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-time { color: var(--muted); font-size: 13px; padding-top: 3px; }
.tl-item .pill { white-space: nowrap; }
.tl-detail { font-size: 14px; white-space: pre-line; word-break: break-word; }
.pill-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 640px) { .tl-item { grid-template-columns: 40px 1fr; } .tl-detail { grid-column: 2; } }
.sms-cell { min-width: 200px; }
.sms-cell summary { cursor: pointer; color: var(--brand); }
.sms-body { white-space: pre-line; font-size: 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-height: 60vh; overflow: auto; }

/* ---------- 날짜별 출석 명단 ---------- */
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; }
.att.on { background: #ecfdf3; border-color: #b7ebc9; }
.att.miss { background: #fef2f2; border-color: #f5c2c0; }
.att .t { color: var(--good); font-size: 12.5px; font-weight: 600; }
.att .c { color: var(--muted); font-size: 12px; }

/* ---------- 반별 수업 출석 ---------- */
.att-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 200px) 44px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.att-row .nm { display: flex; flex-direction: column; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink-2); border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on.good { background: var(--good); color: #fff; }
.seg button.on.warn { background: #f59f00; color: #fff; }
.seg button.on.bad { background: var(--bad); color: #fff; }
.att-note { padding: 6px 10px !important; font-size: 14px !important; }
.att-note:disabled { opacity: .4; }
@media (max-width: 640px) {
  .att-row { grid-template-columns: 1fr auto; }
  .att-row .seg { grid-column: 1 / -1; width: 100%; } .seg button { flex: 1; }
  .att-row .att-note { grid-column: 1; } .att-row .t { text-align: right; }
}

/* ---------- 보강 · 학생 상세 ---------- */
.seg button.on.info { background: var(--brand); color: #fff; }
.pill.info { background: #eef2ff; color: var(--brand-ink); }
.memo-mini { font-size: 12.5px; color: #8a5a00; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-box { white-space: pre-line; background: var(--warn-bg); border: 1px solid #f3d9a4; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); white-space: nowrap; }
.kv b { font-weight: 600; text-align: right; }
.hist { display: flex; flex-direction: column; gap: 6px; }
.hist-item { display: grid; grid-template-columns: 84px auto 1fr; gap: 8px; align-items: center; }
.memo-box + h3, .memo-box + .card-title, .memo-box + h2 { margin-top: 18px; }
