/* 스타랩 센터 내부 홈페이지 — 공통 스타일 */
:root {
  --mint: #17AA9D; --mint-d: #0E8C81; --mint-l: #E3F5F2;
  --red: #EB2027; --orange: #F79420; --green: #3BB54A; --ink: #231F20;
  --bg: #F3F5F4; --surface: #FFFFFF; --line: #E2E7E5; --line-2: #CFD7D4;
  --text: #1F2624; --muted: #66716D; --faint: #98A29E;
  --r: 14px; --r-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 40, 35, .06), 0 4px 14px rgba(20, 40, 35, .05);
  --shadow-up: 0 2px 4px rgba(20, 40, 35, .06), 0 14px 32px rgba(20, 40, 35, .12);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; letter-spacing: -0.01em; min-height: 100vh; display: flex; flex-direction: column; }
body.noscroll { overflow: hidden; }
a { color: var(--mint-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px; }
main.wrap { flex: 1; }
[hidden] { display: none !important; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-mint { background: var(--mint); color: #fff; }
.btn-mint:hover { background: var(--mint-d); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint-d); }
.btn-danger { background: #fff; border-color: #F2C3C5; color: #C81E24; }
.btn-danger:hover { background: #FDEEEE; }
.btn[disabled], .btn:disabled { opacity: .4; pointer-events: none; }

/* ---------- 상단 ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; flex: none; }
.brand img { height: 26px; width: auto; }
.brand-sub { font-size: 12px; font-weight: 700; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 99px; }
.mainnav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a, .mainnav .soon { position: relative; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--muted); white-space: nowrap; text-decoration: none; }
.mainnav a:hover { color: var(--text); background: var(--bg); }
.mainnav a.on { color: var(--ink); }
.mainnav a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 3px; border-radius: 3px 3px 0 0; background: var(--mint); }
.mainnav .soon { color: var(--faint); cursor: default; }
.mainnav a.nav-lock { color: var(--faint); cursor: not-allowed; text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }   /* 선생님 + 외부: 조립도 못 씀 */
.mainnav a.nav-lock em { text-decoration: none; display: inline-block; }
.mainnav .soon em { font-style: normal; font-size: 10px; font-weight: 700; margin-left: 5px; padding: 1px 5px; border-radius: 4px; background: var(--bg); color: var(--faint); vertical-align: 1px; }
.topbar-right { display: flex; gap: 8px; flex: none; align-items: center; }
.topbar-right .who { font-size: 13px; font-weight: 700; color: var(--mint-d); background: var(--mint-l); padding: 5px 10px; border-radius: 99px; }
.login-link { font-size: 13px; font-weight: 600; color: var(--faint); padding: 6px 8px; }
.login-link:hover { color: var(--text); }
.soon-page { text-align: center; padding: 90px 20px; color: var(--muted); }
.soon-page h1 { color: var(--ink); font-size: 28px; margin: 14px 0 8px; }
.soon-page .ic { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; background: var(--mint-l); color: var(--mint-d); display: flex; align-items: center; justify-content: center; font-size: 30px; }

.subbar { background: var(--ink); }
.subbar-in { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 44px; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subbar-title { color: var(--mint); font-weight: 800; font-size: 12px; letter-spacing: .08em; margin-right: 12px; }
.subbar a { color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 7px; white-space: nowrap; text-decoration: none; }
.subbar a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.subbar a.on { color: #fff; background: rgba(23, 170, 157, .28); }
.subbar a.right { margin-left: auto; }
.warnbar { background: #FFF4E5; color: #8A4B00; font-size: 13px; padding: 8px 24px; text-align: center; border-bottom: 1px solid #F8DDB5; }
.warnbar a { color: #B85F00; font-weight: 700; text-decoration: underline; }

.foot { color: var(--faint); font-size: 12px; padding: 32px 0 28px; }

/* ---------- 라이브러리 머리 ---------- */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 40px 0 22px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--mint); }
.lib-head h1 { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 800; color: var(--ink); }
.lib-stat { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.lib-stat b { color: var(--text); font-weight: 700; }
.search { position: relative; display: flex; align-items: center; width: min(440px, 100%); height: 50px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 0 14px; transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(23, 170, 157, .14); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; padding: 0 10px; font-size: 15px; }
.search kbd { font: 600 12px var(--font); color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; }

.series-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; }
.stab { --c: var(--ink); display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.stab:hover { border-color: var(--c); }
.stab i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); padding: 1px 8px; border-radius: 99px; }
.stab.on { background: var(--c); border-color: var(--c); color: #fff; }
.stab.on i { background: rgba(255, 255, 255, .22); color: #fff; }
.stab.on .dot { background: #fff; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--mint)); flex: none; }

.toolrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip i { font-style: normal; color: var(--faint); margin-left: 2px; }
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on i { color: rgba(255, 255, 255, .6); }
.toolrow-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }
select { height: 36px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); padding: 0 30px 0 12px; font-size: 13px; font-weight: 600; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2366716D' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { width: 36px; height: 34px; border: 0; background: transparent; color: var(--faint); font-size: 16px; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- 그룹 + 카드 ---------- */
.group { --c: var(--mint); margin-top: 26px; }
.ghead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.ghead h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.ghead h2 .bar { width: 5px; height: 22px; border-radius: 3px; background: var(--c); }
.ghead h2 i { font-style: normal; font-size: 14px; font-weight: 700; color: var(--faint); }
.more { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 4px; }
.more:hover { color: var(--c); }
.result-note { color: var(--muted); font-size: 14px; margin: 18px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card { --c: var(--mint); position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); border-color: var(--c); }
.card:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }
.card .thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.card .thumb::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); opacity: 0; transition: opacity .18s; }
.card:hover .thumb::before { opacity: 1; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform .3s ease; }
.card:hover .thumb img { transform: scale(1.04); }
.ph { font-size: 30px; font-weight: 800; color: var(--c); opacity: .35; }
.card em { position: absolute; top: 9px; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px; }
.card em.new { left: 9px; background: var(--red); color: #fff; }
.card em.hid { right: 9px; background: var(--ink); color: #fff; }
.cbody { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px 14px; flex: 1; }
.cmeta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmeta .dot { width: 7px; height: 7px; }
.ctitle { font-weight: 700; font-size: 15px; line-height: 1.38; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.bd { font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; background: var(--bg); color: var(--muted); }
.bd-pdf { background: #FDECEC; color: #C81E24; }
.bd-io { background: #E8F1FD; color: #2F67C8; }
.bd-zip { background: #FFF1DF; color: #B36200; }
.bd-program { background: #E8F6EA; color: #23862F; }
.size-s .cbody { padding: 10px 11px 11px; }
.size-s .ctitle { font-size: 13.5px; }
.size-s .badges { display: none; }

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

/* ---------- 상세 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-back { position: absolute; inset: 0; background: rgba(20, 26, 24, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.modal-box { --c: var(--mint); position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); width: min(1100px, 100%); max-height: calc(100vh - 48px); background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); transform: translateY(12px) scale(.985); opacity: 0; transition: transform .22s ease, opacity .22s ease; }
.modal.show .modal-back { opacity: 1; }
.modal.show .modal-box { transform: none; opacity: 1; }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg); font-size: 16px; color: var(--muted); }
.modal-x:hover { background: var(--ink); color: #fff; }
.modal-box { overflow-x: hidden; max-width: 100%; }   /* 팝업 좌우 스크롤 금지 */
.m-media, .m-info { min-width: 0; max-width: 100%; }  /* 큰 사진·긴 글이 칸을 넓히지 않게 */
.m-media { display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); min-height: 0; }
.m-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px; min-height: 340px; min-width: 0; }
.m-main img { max-width: 100%; max-height: 62vh; object-fit: contain; }
.m-main.noimg::after { content: "이미지 없음"; color: var(--faint); font-weight: 600; }
.m-thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }   /* 사진이 많으면 줄을 바꿈 (옆으로 밀지 않음) */
.m-info, .m-desc, .m-path { overflow-wrap: anywhere; word-break: break-word; }
/* 조립도 화면 전체: 어떤 경우에도 좌우 스크롤 없음
   (html 은 index.php 에서 막음. body 를 막으면 위쪽 메뉴 고정(sticky)이 풀려서 본문(.lib)을 막음) */
body.page-lib .lib { overflow-x: hidden; }
@supports (overflow-x: clip) { body.page-lib .lib { overflow-x: clip; } }   /* clip 은 스크롤 칸을 만들지 않아 아래 고정 줄(sticky)이 됨 (hidden 이면 고정이 안 됨 — 옛 Safari 는 고정 없이) */
.lib-stick { position: -webkit-sticky; position: sticky; top: 0; z-index: 40; background: var(--bg); margin: 0 -2px; padding: 6px 2px 0; }   /* 조립도: 시리즈 줄 고정 (top 은 index.php) */
body.page-lib .lib, body.page-lib .grid, body.page-lib .card { min-width: 0; max-width: 100%; }
body.page-lib img { max-width: 100%; }
.m-thumbs:empty { display: none; }
.m-thumbs button { flex: none; width: 64px; height: 52px; padding: 3px; border-radius: 8px; border: 2px solid var(--line); background: #fff; }
.m-thumbs button.on { border-color: var(--c); }
.m-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.m-info { display: flex; flex-direction: column; padding: 30px 28px 22px; overflow-y: auto; min-height: 0; }
.m-path { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.m-path span { color: var(--faint); }
.m-info h2 { margin: 0 40px 10px 0; font-size: 26px; line-height: 1.3; letter-spacing: -0.03em; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.m-desc { margin: 0 0 10px; color: var(--muted); white-space: pre-line; }
.m-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.m-tags span { font-size: 12px; font-weight: 600; color: var(--mint-d); background: var(--mint-l); padding: 2px 9px; border-radius: 99px; }
.m-h { margin: 18px 0 10px; font-size: 13px; font-weight: 800; color: var(--faint); letter-spacing: .06em; }
.m-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.m-files li { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.m-files li:hover { border-color: var(--line-2); background: #FAFBFB; }
.m-files li.fk-pdf { padding: 0; }
.m-files .fopen { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; color: inherit; text-decoration: none; }
.m-files .fopen:hover .btn { background: var(--mint-d); }
/* 긴 파일 이름이 줄을 넓혀 '열기'가 잘리지 않게: 이름은 두 줄까지 줄바꿈, 버튼은 늘 오른쪽에 */
.m-files li, .m-files .fopen { min-width: 0; max-width: 100%; }
.m-files .fic, .m-files .btn { flex: none; }
.m-files .fname b { white-space: normal; overflow-wrap: anywhere; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.fic { flex: none; width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; background: var(--bg); color: var(--muted); }
.fk-pdf .fic { background: #FDECEC; color: #C81E24; }
.fk-io .fic { background: #E8F1FD; color: #2F67C8; }
.fk-zip .fic { background: #FFF1DF; color: #B36200; }
.fk-program .fic { background: #E8F6EA; color: #23862F; }
.fname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fname b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fname small { font-size: 12px; color: var(--faint); }
.nofile { color: var(--faint); justify-content: center; }
.m-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 22px; color: var(--faint); font-size: 13px; }
.m-edit { margin-top: 12px; font-size: 13px; font-weight: 600; text-align: center; }

/* ---------- 폼/관리자 공통 ---------- */
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 32px 0 18px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 26px; letter-spacing: -0.03em; }
.page-title p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 16px; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 700; color: var(--text); }
.field .req { color: var(--red); }
.field small, .hint { font-size: 12px; color: var(--faint); }
.input, textarea.input, select.input { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; padding: 0 13px; font-size: 15px; outline: 0; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 11px 13px; resize: vertical; }
select.input { padding-right: 34px; background-position: right 14px center; }
.input:focus { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(23, 170, 157, .14); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.notice.ok { background: var(--mint-l); color: #0B6C63; }
.notice.err { background: #FDEEEE; color: #B0171D; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { transform: translateX(18px); }

/* 로그인 */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-up); padding: 36px 32px 30px; }
.login-card img { height: 34px; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 0 0 4px; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.login-card .btn { width: 100%; height: 48px; font-size: 15px; margin-top: 6px; }

/* 관리자 목록 */
.alist-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.alist-tools .input { width: auto; height: 40px; font-size: 14px; }
.alist-tools .search-in { flex: 1; min-width: 200px; }
.atable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.atable th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); background: #FAFBFB; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.atable tr:last-child td { border-bottom: 0; }
.atable tr:hover td { background: #FAFCFB; }
.atable .tth { width: 72px; }
.atable .tth span { display: flex; width: 64px; height: 48px; border: 1px solid var(--line); border-radius: 8px; background: #fff; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); font-size: 11px; }
.atable .tth img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.atable .ttl b { display: block; font-weight: 700; }
.atable .ttl small { color: var(--faint); }
.atable .tact { white-space: nowrap; text-align: right; }
.atable .tact .btn { margin-left: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tag-hidden { font-size: 11px; font-weight: 700; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 2px; }

/* 등록/수정 */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.drop { display: block; position: relative; border: 2px dashed var(--line-2); border-radius: 14px; background: #FAFBFB; padding: 26px 18px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--mint); background: var(--mint-l); }
.drop b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.flist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.flist li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.flist li.pending { border-style: dashed; border-color: var(--mint); }
.flist li.gone { opacity: .45; text-decoration: line-through; }
.flist .fic { width: 36px; height: 36px; font-size: 10px; border-radius: 8px; }
.flist .fname b { font-size: 13.5px; }
.flist .prog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.flist .prog i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .15s; }
.fhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.fhead h2 { margin: 0; }
.fhead .btn { flex: none; margin-left: 10px; }
.flist li .btn { flex: none; }
.flist .x { border: 0; background: none; color: var(--faint); font-size: 18px; width: 30px; height: 30px; border-radius: 8px; }
.flist .x:hover { background: #FDEEEE; color: var(--red); }
.thumb-box { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; margin-bottom: 12px; color: var(--faint); font-size: 13px; }
.thumb-box img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.thumb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb-btns .btn { flex: 1; position: relative; overflow: hidden; }
.thumb-btns input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* PDF 쪽으로 썸네일 (첫장 · 쪽 번호 · 막장) — 사파리 13: flex gap 대신 margin */
.thumb-pdf { display: flex; align-items: center; margin-top: 10px; }
.thumb-pdf > * { margin-right: 6px; }
.thumb-pdf > *:last-child { margin-right: 0; }
.thumb-pdf .tp-lab { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.thumb-pdf .btn { flex: none; }
.thumb-pdf .tp-num { flex: 1; min-width: 0; display: flex; align-items: center; }
.thumb-pdf .tp-num input { width: 100%; min-width: 0; height: 32px; padding: 0 6px; text-align: center; }
.thumb-pdf .tp-num span { flex: none; margin-left: 4px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.thumb-pdf.busy { opacity: .55; pointer-events: none; }
.savebar { position: sticky; bottom: 0; z-index: 20; margin-top: 16px; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(243, 245, 244, 0)); display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.savebar .status { margin-right: auto; font-size: 14px; color: var(--muted); }
.savebar .btn { height: 46px; padding: 0 24px; }
.inline-add { display: flex; gap: 8px; margin-top: 8px; }
.inline-add .input { height: 38px; font-size: 14px; }

/* 카테고리 */
.cat-series { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.cat-series > .cat-row { background: #FAFBFB; border-bottom: 1px solid var(--line); }
.cat-row .input { height: 38px; font-size: 14px; }
.cat-row .nm { flex: 1; min-width: 120px; }
.cat-row .ord { width: 76px; }
.cat-row input[type=color] { width: 40px; height: 38px; padding: 2px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; cursor: pointer; }
.cat-row .cnt { font-size: 12px; color: var(--faint); width: 52px; text-align: right; white-space: nowrap; }
.cat-cols .cat-row { padding-left: 38px; border-bottom: 1px solid var(--line); }
.cat-cols .cat-row:last-child { border-bottom: 0; }
.cat-cols .cat-row::before { content: "└"; color: var(--line-2); margin-left: -20px; margin-right: 4px; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .modal { padding: 0; align-items: stretch; }
  .modal-box { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; width: 100%; max-height: 100vh; height: 100%; border-radius: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
  .m-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .m-main { min-height: 240px; padding: 20px; }
  .m-main img { max-height: 42vh; }
  .m-info { overflow: visible; }
  .edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap, .topbar-in, .subbar-in { padding-left: 16px; padding-right: 16px; }
  .topbar-in { height: 58px; gap: 12px; }
  .brand img { height: 20px; }
  .brand-sub { display: none; }
  .mainnav a.on::after { bottom: -10px; }
  .topbar-right .btn-ghost { padding: 0 9px; font-size: 12px; }
  .topbar-right .btn-ghost:not(.btn-keep) { display: none; }
  .topbar-right .who { display: none; }
  .lib-head { padding: 24px 0 14px; }
  .lib-head h1 { font-size: 26px; }
  .search { width: 100%; }
  .search kbd { display: none; }
  .size-s .cmeta { display: none; }
  .ctitle { font-size: 14px; }
  .toolrow { flex-wrap: wrap; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .atable .hide-m { display: none; }
  .m-info h2 { font-size: 22px; }
}

/* ---------- 조립도 보기(viewer.php) ---------- */
body.viewer { height: 100vh; overflow: hidden; background: #2A302E; user-select: none; -webkit-user-select: none; }
.vbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 16px; background: #fff; border-bottom: 3px solid var(--c, var(--mint)); }
.vback { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 20px; font-weight: 700; text-decoration: none !important; }
.vback:hover { background: var(--ink); color: #fff; }
.vtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vtitle small { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.vtitle small .dot { width: 7px; height: 7px; }
.vtitle strong { font-size: 17px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vsel { max-width: 220px; }
.vtools { flex: none; display: flex; align-items: center; gap: 4px; }
.vtools button { min-width: 38px; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font-size: 16px; font-weight: 700; }
.vtools button:hover { border-color: var(--ink); }
.vtools .vfit { font-size: 13px; min-width: 56px; }
.vpage { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vpages { position: absolute; top: 63px; left: 0; right: 0; bottom: 0; overflow: auto; padding: 20px 16px 20px; display: flex; flex-direction: column; align-items: center; -webkit-overflow-scrolling: touch; outline: none; }
.vpages .vpage-box { margin-bottom: 16px; }   /* Safari 13: flex gap 대신 margin */
/* 왼쪽 썸네일 목록: 마우스를 왼쪽 끝으로 → 열림, 치우면 닫힘 */
.vthumb-hot { position: absolute; top: 63px; left: 0; bottom: 0; width: 26px; z-index: 3; }
.vthumb-tab { position: absolute; z-index: 3; left: 0; top: 50%; transform: translateY(-50%); width: 22px; padding: 12px 0; border: 0; border-radius: 0 10px 10px 0; background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .6); font-size: 11px; font-weight: 700; line-height: 1.25; writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; letter-spacing: 2px; cursor: pointer; transition: opacity .2s; }
.vthumbs { position: absolute; z-index: 4; top: 63px; left: 0; bottom: 0; width: 148px; overflow-y: auto; overflow-x: hidden; padding: 14px 10px 30px 14px; background: rgba(24, 28, 27, .94); box-shadow: 6px 0 24px rgba(0, 0, 0, .35); transform: translateX(-105%); -webkit-transform: translateX(-105%); transition: transform .22s ease, -webkit-transform .22s ease; -webkit-overflow-scrolling: touch; }
body.vt-open .vthumbs { transform: none; -webkit-transform: none; }
body.vt-open .vthumb-tab { opacity: 0; }
.vthumb { display: block; margin-bottom: 12px; text-align: center; color: #AEB6B3; text-decoration: none; font-size: 12px; font-weight: 700; }
.vthumb-img { display: block; width: 108px; min-height: 40px; margin: 0 auto 4px; background: #fff; border-radius: 3px; overflow: hidden; border: 3px solid transparent; box-sizing: content-box; }
.vthumb-img canvas { display: block; width: 100%; height: auto; pointer-events: none; }
.vthumb:hover .vthumb-img { border-color: rgba(255, 255, 255, .45); }
.vthumb.on .vthumb-img { border-color: var(--c, var(--mint)); }
.vthumb.on b { color: #fff; }
.vpage-box { flex: none; position: relative; background: #fff; border-radius: 4px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.vpage-box span { color: #C8CFCC; font-size: 28px; font-weight: 800; }
.vpage-box canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.vmsg { color: #D7DDDA; margin-top: 80px; font-size: 15px; text-align: center; }
@media (max-width: 640px) {
  .vbar { gap: 8px; padding: 0 10px; }
  .vpage { display: none; }
  .vsel { max-width: 110px; }
  .vtools button { min-width: 34px; padding: 0 6px; }
  .vtools .vfit { min-width: 46px; }
  .vpages { padding: 12px 8px 12px; }
  .vpages .vpage-box { margin-bottom: 10px; }
}
@media print { body.viewer * { display: none !important; } }

/* ---------- 주간 시간표 ---------- */
.tt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 0 18px; flex-wrap: wrap; }
.tt-head h1 { margin: 0; font-size: 32px; letter-spacing: -0.03em; font-weight: 800; color: var(--ink); }
.tt-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.tt-sub b { color: var(--text); }
.tt-ay { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 99px; background: #EEF8F5; color: #0E7A66; font-weight: 800; font-size: 12.5px; }
.tt-search { width: min(320px, 100%); height: 46px; }
.tt-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tt-tools .chip i { font-style: normal; font-weight: 500; opacity: .75; }
.tt-view button { width: auto; padding: 0 14px; font-size: 13px; font-weight: 700; }
.tt-days { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.tt-day { flex: 1; min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.tt-day b { font-size: 18px; color: var(--ink); }
.tt-day small { font-size: 12px; color: var(--muted); font-weight: 600; }
.tt-day.today { border-color: var(--mint); }
.tt-day.hit { box-shadow: inset 0 -3px 0 var(--orange); }
.tt-day.on { background: var(--ink); border-color: var(--ink); }
.tt-day.on b, .tt-day.on small { color: #fff; }
.tt-scroll { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.tt-week, .tt-dayt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tt-week { min-width: 980px; }
.tt-dayt { min-width: calc(var(--n, 4) * 180px + 70px); }
.tt-week th, .tt-dayt th { position: sticky; top: 0; background: #FAFBFB; font-size: 14px; font-weight: 800; color: var(--ink); padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.tt-week th small, .tt-dayt th small { font-weight: 600; color: var(--faint); font-size: 12px; margin-left: 4px; }
.tt-week th.today { color: var(--mint-d); }
.tt-headfix { position: fixed; z-index: 45; overflow: hidden; background: #FAFBFB; border-bottom: 1px solid var(--line); box-shadow: 0 3px 8px rgba(0,0,0,.08); }   /* 요일 줄 고정 (schedule.js headBuild) */
.tt-headfix[hidden] { display: none; }
.tt-headfix table { border-collapse: collapse; table-layout: fixed; }
.tt-headfix th { border-bottom: 0 !important; }
@media print { .tt-headfix { display: none !important; } }
body:not(.tt-fit):not(.tt-print) .tt-days { position: -webkit-sticky; position: sticky; top: 0; z-index: 44; background: var(--bg); padding: 6px 0 8px; margin-bottom: 6px; }   /* 요일별: 요일 줄 고정 (top 은 schedule.js daysTop) */
.tt-week th em { font-style: normal; font-size: 11px; font-weight: 800; background: var(--mint); color: #fff; padding: 1px 6px; border-radius: 99px; margin-left: 4px; vertical-align: 2px; }
.tt-week td, .tt-dayt td { vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.tt-week td.today { background: #F4FBFA; }
.tt-week tr:last-child td, .tt-dayt tr:last-child td, .tt-week tr:last-child th, .tt-dayt tr:last-child th { border-bottom: 0; }
.tt-rh { width: 58px; }
.tt-dayt .tt-rh { width: 70px; }
th.tt-rh { background: #FAFBFB !important; vertical-align: top; padding-top: 14px !important; }
th.tt-rh span { display: inline-block; font-size: 13px; font-weight: 800; color: var(--muted); }
.tt-week td > .tt-card + .tt-card { margin-top: 6px; }
.tt-dayt td > .tt-card + .tt-card { margin-top: 8px; }
.tt-card { --k: #8A9490; --kb: #F1F3F2; border: 1px solid var(--line); border-left: 4px solid var(--k); border-radius: 10px; padding: 7px 9px 8px; background: #fff; transition: opacity .15s; }
.tt-card-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tt-t { font-size: 11px; font-weight: 800; color: #fff; background: var(--ink); padding: 1px 6px; border-radius: 5px; }
.tt-code { font-size: 13px; font-weight: 800; color: var(--k); background: var(--kb); padding: 1px 7px; border-radius: 5px; }
.tt-time { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.tt-names { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.tt-dayt .tt-names { flex-direction: column; font-size: 15px; gap: 2px; }
.tt-names .nm { display: inline-flex; align-items: center; gap: 3px; border-radius: 99px; }
.tt-names .nm.hit { background: #FFE7B8; padding: 0 6px; font-weight: 800; }
.nm i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 900; color: #fff; flex: none; }
.nm.mk, .nm.wk, .nm.ab { padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; }
.nm.mk { background: #FFE2C2; color: #A04B00; box-shadow: inset 0 0 0 1.5px #F79420; }
.nm.mk i { background: #F79420; }
.nm.wk { background: #DCEBFF; color: #1D4FA8; box-shadow: inset 0 0 0 1.5px #3B7BE0; }
.nm.wk i { background: #3B7BE0; }
.nm.ab { background: #F3F4F4; color: #9AA3A0; text-decoration: line-through; text-decoration-color: #EB2027; box-shadow: inset 0 0 0 1.5px #F2B6B8; }
.nm.ab i { background: #EB2027; text-decoration: none; }
/* 휴원 (학생관리 › 휴원): 회색, 인원에서 빠짐 */
.nm.hu { padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; border-radius: 99px; background: #EEF0F2; color: #8A949C; box-shadow: inset 0 0 0 1.5px #C9CFD4; }
.nm.hu i { background: #8A949C; }
.tt-legend .nm.hu { padding: 1px 9px; font-size: 12px; }
.tt-dayt .tt-names .nm.hu { align-self: flex-start; }
.nm.unk { padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; background: #F0EAFD; color: #5B34B5; box-shadow: inset 0 0 0 1.5px #9B7BE6; border: 0; outline: 1.5px dashed #9B7BE6; outline-offset: -1.5px; }
.nm.unk i { background: #7A4FD8; }
.nm.unk small { font-size: 10px; font-weight: 800; margin-left: 4px; opacity: .75; }
.tt-legend .nm.unk { outline: 0; }
.tt-dayt .tt-names .nm.unk,
.tt-dayt .tt-names .nm.mk, .tt-dayt .tt-names .nm.wk, .tt-dayt .tt-names .nm.ab { align-self: flex-start; }
.tt-card.is-full { background: #FFF0F0; border-color: #F6C3C5; }
.tt-full { font-size: 11px; font-weight: 900; color: #fff; background: var(--red); padding: 1px 6px; border-radius: 5px; }
.tt-count b { color: var(--text); }
.tt-card.is-full .tt-count b { color: var(--red); }
.tt-weeknav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tt-live { font-size: 12.5px; color: var(--muted); margin-left: 8px; display: inline-flex; align-items: center; gap: 6px; }
.tt-live .warn, .tt-live b.warn { color: #B0171D; }
.dotlive { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(59, 181, 74, .2); }
.dotlive.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(247, 148, 32, .2); }
.tt-legend { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tt-legend .nm { display: inline-flex; padding: 1px 9px; border-radius: 99px; font-size: 12px; }
.tt-legend .nm.ab { text-decoration: none; color: #B0171D; }
.lg-full { font-size: 12px; font-weight: 800; color: #B0171D; background: #FFF0F0; border: 1px solid #F6C3C5; padding: 1px 9px; border-radius: 6px; }
.tt-allrow td, .tt-allrow th { background: #FBFAF4 !important; }
.tt-ev { font-size: 12.5px; line-height: 1.4; padding: 3px 0; color: var(--text); border-bottom: 1px dashed var(--line); }
.tt-ev:last-child { border-bottom: 0; }
.tt-ev b { color: var(--mint-d); font-variant-numeric: tabular-nums; }
.tt-allday { background: #FBFAF4; border: 1px solid #ECE6CF; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.tt-allday > span { font-size: 12px; font-weight: 800; color: #8A7A36; }
.tt-unplaced { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.tt-unplaced h3 { margin: 0 0 10px; font-size: 15px; }
.tt-unplaced h3 small { font-weight: 500; color: var(--faint); font-size: 12px; margin-left: 6px; }
.tt-unplaced ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.tt-unplaced li small { color: var(--faint); }
.tt-unplaced details { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.tt-unplaced summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.tt-none { color: var(--faint); font-size: 12px; }
.tt-count { font-size: 11px; color: var(--faint); font-weight: 700; margin-top: 4px; text-align: right; }
.tt-card.is-dim { opacity: .28; }
.tt-card.is-hit { box-shadow: 0 0 0 2px var(--orange); }
.tt-empty { color: var(--line-2); font-weight: 700; }
.tt-emptyrow td { text-align: center; color: var(--faint); }
.k-rp { --k: #D9363E; --kb: #FDECEC; }
.k-rs { --k: #0E8C81; --kb: #E3F5F2; }
.k-rb { --k: #D97A06; --kb: #FFF1DF; }
.k-c  { --k: #2F67C8; --kb: #E8F1FD; }
.k-m  { --k: #7A4FD8; --kb: #F0EAFD; }
.k-age { --k: #23862F; --kb: #E8F6EA; }
.tt-mlist { display: flex; flex-direction: column; gap: 16px; }
.tt-mrow h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--ink); }
.tt-mrow .tt-card + .tt-card { margin-top: 8px; }
.tt-mrow .tt-names { font-size: 15px; }
.tt-foot { margin: 14px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.7; }
@media (max-width: 640px) {
  .tt-head { padding: 22px 0 12px; }
  .tt-head h1 { font-size: 26px; }
  .tt-tools .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .tt-tools .chip { flex: none; }
}
@media print {
  .topbar, .tt-tools, .tt-days, .tt-search, .tt-foot, .foot { display: none !important; }
  body { background: #fff; }
  .tt-scroll { overflow: visible; box-shadow: none; }
  .tt-week { min-width: 0; font-size: 11px; }
}

/* 반 필터 + 정원 초과 */
.tt-filters { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.tt-frow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tt-flabel { flex: none; width: 44px; font-size: 12px; font-weight: 800; color: var(--faint); }
.tt-frow .chips { flex: 1; min-width: 0; }
.chip.cchip { color: var(--k); background: var(--kb); border-color: transparent; font-weight: 800; }
.chip.cchip i { color: var(--k); opacity: .6; }
.chip.cchip.on { background: var(--k); color: #fff; border-color: var(--k); }
.chip.cchip.on i { color: rgba(255,255,255,.75); opacity: 1; }
.chip.cchip.k-etc { --k: #66716D; --kb: #EEF1F0; }
.tt-card.is-over { background: #FFC9CC; border-color: #D9363E; box-shadow: 0 0 0 1.5px #D9363E, 0 6px 16px rgba(217, 54, 62, .22); }
.tt-card.is-over .tt-names, .tt-card.is-over .tt-time { color: #4A0D10; }
.tt-over { font-size: 11px; font-weight: 900; color: #fff; background: #9E1219; padding: 1px 7px; border-radius: 5px; letter-spacing: .02em; }
.tt-card.is-over .tt-count b { color: #9E1219; font-size: 13px; }
.lg-over { font-size: 12px; font-weight: 800; color: #fff; background: #C2252D; padding: 1px 9px; border-radius: 6px; }
@media (max-width: 640px) {
  .tt-frow { align-items: flex-start; }
  .tt-frow .chips { flex-wrap: nowrap; overflow-x: auto; }
  .tt-frow .chip { flex: none; }
  .tt-flabel { width: 34px; padding-top: 8px; }
}

/* 체험 · 선생님 색 · 만석(진한 금색) */
.nm.tr { padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; background: #D9F7DF; color: #146C2E; box-shadow: inset 0 0 0 1.5px #22A447; }
.nm.tr i { background: #22A447; }
.tt-legend .nm.tr { display: inline-flex; padding: 1px 9px; border-radius: 99px; font-size: 12px; }
.tt-dayt .tt-names .nm.tr { align-self: flex-start; }
.tt-t { color: #fff; }
.tt-dayt th .tt-t { font-size: 13px; padding: 2px 9px; border-radius: 6px; margin-right: 2px; }
.chip.tchip { display: inline-flex; align-items: center; gap: 6px; }
.chip.tchip .tdot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); }
.chip.tchip.on { background: var(--tc); border-color: var(--tc); color: #fff; }
.chip.tchip.on .tdot { background: #fff; }
.chip.tchip.on i { color: rgba(255,255,255,.75); }
.tt-card.is-full { background: #FFE38A; border-color: #C98A00; box-shadow: 0 0 0 1.5px #C98A00, 0 6px 16px rgba(201, 138, 0, .22); }
.tt-card.is-full .tt-names, .tt-card.is-full .tt-time { color: #3D2A00; }
.tt-full { background: #8A5A00 !important; color: #fff; }
.tt-card.is-full .tt-count b { color: #7A4F00; font-size: 13px; }
.lg-full { color: #fff !important; background: #B07A00 !important; border-color: #B07A00 !important; }

.tt-unplaced .tt-trials summary { color: #146C2E; }
.tt-unplaced .tt-trials li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tt-unplaced .tt-trials .tt-code { font-size: 12px; }
.tt-unplaced .tt-regs summary { color: #8A4B00; }   /* 신규 등록 · 예정 목록 */

/* 더블 수업 (같은 시간·같은 선생님 2개 반) — 한 장에 반별 한 줄씩, 높이 최소화 */
.tt-card.tt-double { background-image: repeating-linear-gradient(135deg, rgba(35,31,32,.035) 0 6px, transparent 6px 12px); }
.tt-dbl { font-size: 11px; font-weight: 900; color: #fff; background: #231F20; padding: 1px 7px; border-radius: 5px; letter-spacing: .02em; }
.tt-part { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; margin-top: 5px; padding: 4px 0 0 7px; border-top: 1px dashed var(--line-2); border-left: 3px solid var(--k); font-size: 13.5px; line-height: 1.45; }
.tt-part .tt-code { font-size: 11.5px; padding: 0 6px; }
.tt-part .tt-full, .tt-part .tt-over { font-size: 10px; padding: 0 5px; }
.tt-subtime { font-size: 11px; font-weight: 700; color: var(--muted); }
.tt-part .tt-none { font-size: 12px; }
.tt-double .tt-count { margin-top: 3px; }
.tt-dayt .tt-part { font-size: 14.5px; }
/* 보강 종류: 주중(파랑) · 개별(청록) · 특별(주황) · 구분 없음(갈색) */
.nm.iv, .nm.sp { padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; }
.nm.iv { background: #CFF4F8; color: #0B5F6E; box-shadow: inset 0 0 0 1.5px #0E9AB0; }
.nm.iv i { background: #0E9AB0; }
.nm.sp { background: #FFE2C2; color: #A04B00; box-shadow: inset 0 0 0 1.5px #F79420; }
.nm.sp i { background: #F79420; }
.nm.mk { background: #EFE6DA; color: #6B4A26; box-shadow: inset 0 0 0 1.5px #9C7A52; }
.nm.mk i { background: #9C7A52; }
.tt-legend .nm.iv, .tt-legend .nm.sp { display: inline-flex; padding: 1px 9px; border-radius: 99px; font-size: 12px; }
.tt-dayt .tt-names .nm.iv, .tt-dayt .tt-names .nm.sp { align-self: flex-start; }

/* 결석·보강·체험 이름표: 어디서든(더블 수업 줄, 체험현황 목록 등) 둥근 모양 */
.nm.ab, .nm.mk, .nm.wk, .nm.iv, .nm.sp, .nm.tr, .nm.unk { display: inline-flex; align-items: center; gap: 3px; border-radius: 99px; white-space: nowrap; }
.nm.hit { border-radius: 99px; }

/* 이름 말풍선 (연락처 + 보강 정보) */
.nm[data-n] { cursor: pointer; }
.tt-tip { position: absolute; z-index: 300; max-width: 320px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 30, 28, .2); padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; pointer-events: none; }
.tt-tip.pinned { pointer-events: auto; border-color: var(--ink); }
.tt-tip .tip-n { font-size: 15px; color: var(--ink); }
.tt-tip .tip-tel { font-size: 15px; font-weight: 800; color: var(--mint-d); text-decoration: none; font-variant-numeric: tabular-nums; }
.tt-tip.pinned .tip-tel { text-decoration: underline; }
.tt-tip .tip-none { color: var(--faint); font-size: 12px; }
.tt-tip .tip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tt-tip .tip-row small { color: var(--muted); }
.tt-tip .tip-unk { color: #5B34B5; font-weight: 700; font-size: 12px; }
@media print { .tt-tip { display: none !important; } }

/* 보기 방식 버튼: 주 이동 버튼 옆 */
.tt-weeknav .tt-view { margin-left: 6px; }
.tt-weeknav .tt-view button { height: 34px; }
@media (max-width: 700px) {
  .tt-weeknav { gap: 6px; }
  .tt-weeknav { gap: 5px; }
  .tt-weeknav .btn-sm { padding: 0 8px; height: 32px; font-size: 12px; }
  .tt-weeknav .tt-view { margin-left: 0; }
  .tt-weeknav .tt-view button { padding: 0 8px; height: 30px; font-size: 12px; }
  .tt-live { margin-left: 0; width: 100%; }
  .tt-legend { margin-left: 0; }
  /* 요일 버튼: 인원수 빼고 한 줄에 다섯 개 */
  .tt-days { gap: 5px; overflow: visible; }
  .tt-day { min-width: 0; padding: 7px 2px; border-radius: 10px; }
  .tt-day b { font-size: 16px; }
  .tt-day small { font-size: 11px; }
  .tt-day .dcnt { display: none; }
}

#ttViewPc { flex: none; align-self: flex-start; }
#ttViewPc .tt-view { margin-left: 0; }
#ttViewPc .tt-view button { height: 36px; }

/* 태블릿(아이패드 세로 등): 요일별 표가 화면 폭에 맞게 — 좌우 스크롤 없이 */
@media (min-width: 700px) {
  .tt-dayt { min-width: 0; }
  .tt-dayt td { overflow-wrap: anywhere; }
  .tt-dayt .tt-card { min-width: 0; }
}
@media (min-width: 700px) and (max-width: 1000px) {
  .tt-dayt .tt-rh { width: 54px; }
  .tt-dayt td { padding: 6px; }
  .tt-dayt .tt-card { padding: 6px 7px 7px; }
  .tt-dayt .tt-names { font-size: 14px; }
  .tt-dayt .tt-part { font-size: 13.5px; }
}

/* 화면 꽉 채우기 (주간 한눈에·요일별을 스크롤 없이 한 화면에) */
.tt-titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tt-titlerow h1 { margin: 0; }
.tt-fitlabel { display: none; }
.tt-fitbtn { flex: none; }
@media (max-width: 899px) { .tt-fitbtn { display: none !important; } }
body.tt-fit { overflow: hidden; }
body.tt-fit .topbar, body.tt-fit .tt-head, body.tt-fit #ttAll,
body.tt-fit .tt-foot, body.tt-fit .foot, body.tt-fit .notice { display: none !important; }
body.tt-fit main.wrap { max-width: none; width: 100%; padding: 8px 12px 0; margin: 0; }
body.tt-fit .tt-weeknav { margin-bottom: 6px; flex-wrap: nowrap; }
body.tt-fit .tt-weeknav .tt-fitbtn { margin-left: auto; }
body.tt-fit .tt-fitlabel { display: inline-block; font-size: 17px; font-weight: 900; color: var(--ink); margin: 0 6px 0 4px; white-space: nowrap; }
body.tt-fit .tt-live { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.tt-fit .tt-legend { white-space: nowrap; }
/* 필터는 한 줄로 */
body.tt-fit .tt-tools { margin: 0 0 6px; padding: 6px 10px; gap: 10px; }
body.tt-fit .tt-filters { flex-direction: row; gap: 6px 18px; flex-wrap: wrap; }
body.tt-fit .tt-frow { gap: 6px; min-width: 0; }
body.tt-fit .tt-flabel { width: auto; }
body.tt-fit .tt-tools .chips { flex-wrap: wrap; gap: 4px; }
body.tt-fit .tt-tools .chip { flex: none; height: 28px; padding: 0 10px; font-size: 12.5px; }
body.tt-fit .tt-days { margin-bottom: 6px; }
body.tt-fit #ttBody { overflow: hidden; }
body.tt-fit .tt-scroll { overflow: hidden; }
body.tt-fit .tt-week, body.tt-fit .tt-dayt { min-width: 0 !important; }
body.tt-fit .tt-scroll.stretch .tt-week, body.tt-fit .tt-scroll.stretch .tt-dayt { height: 100%; }
body.tt-fit .tt-week th, body.tt-fit .tt-dayt th { position: static; }
/* 꽉 채우기에서도 아래쪽 체험현황·다른 일정 표시 (펼치면 최대 화면 1/3, 넘치면 그 안에서 스크롤) */
body.tt-fit #ttUnplaced { margin-top: 8px; padding: 8px 14px; max-height: 33vh; overflow-y: auto; }
body.tt-fit #ttUnplaced h3 { margin-bottom: 6px; font-size: 14px; }
body.tt-fit #ttUnplaced details { margin-top: 6px; }
body.tt-fit #ttUnplaced summary { margin-bottom: 4px; }
/* 꽉 채우기: 레이아웃은 그대로, 아이들 이름만 크게 (크기는 --namefs, 화면에 맞는 최대 배율은 fitApply 가 계산)
   인원(n/5명)은 아래 줄 대신 머리글의 수업 시간 앞으로 옮겨 한 줄을 아낌 */
.tt-hcount { display: none; }
body.tt-fit .tt-hcount { display: inline; margin-left: auto; font-size: 11px; font-weight: 700; color: var(--faint); white-space: nowrap; }
body.tt-fit .tt-hcount b { color: var(--text); }
body.tt-fit .tt-card.is-full .tt-hcount b { color: #7A4F00; font-size: 13px; }
body.tt-fit .tt-card.is-over .tt-hcount b { color: #9E1219; font-size: 13px; }
body.tt-fit .tt-hcount + .tt-time { margin-left: 6px; }
body.tt-fit .tt-count { display: none; }
body.tt-fit #ttBody .tt-names, body.tt-fit #ttBody .tt-part { font-size: var(--namefs, 24px); }
body.tt-fit #ttBody .tt-dayt .tt-names { font-size: calc(var(--namefs, 24px) + 1.5px); }
body.tt-fit #ttBody .nm.ab, body.tt-fit #ttBody .nm.mk, body.tt-fit #ttBody .nm.wk, body.tt-fit #ttBody .nm.iv, body.tt-fit #ttBody .nm.sp, body.tt-fit #ttBody .nm.tr, body.tt-fit #ttBody .nm.unk { font-size: calc(var(--namefs, 24px) - 1px); }
/* 꽉 채우기 · 요일별: 선생님 이름표를 이름 글씨만큼 크게 + 선생님 이름 칸만 선생님 색으로 연하게, 열 사이 선생님 색 구분선 */
body.tt-fit .tt-dayt th.tcol { background: var(--thb) !important; border-left: 2px solid var(--tln); padding: 8px 6px; }
body.tt-fit .tt-dayt th.tcol .tt-t { font-size: calc(var(--namefs, 24px) + 2px); padding: 2px 12px; border-radius: 8px; vertical-align: middle; }
body.tt-fit .tt-dayt th.tcol small { font-size: calc(var(--namefs, 24px) - 4px); font-weight: 700; color: var(--muted); vertical-align: middle; margin-left: 8px; }
body.tt-fit .tt-dayt td.tcol { border-left: 2px solid var(--tln); }   /* 칸 배경은 교시 색 그대로, 선생님 색 구분선만 */
/* 크롬에서는 꽉 채우기 버튼 숨김 */
html.is-chrome .tt-fitbtn { display: none !important; }

/* 교시별 은은한 배경색 */
.tt-p1 { --pb: #EEF8F5; --ph: #D7F0E8; --pt: #0E7A66; }
.tt-p2 { --pb: #F0F3FD; --ph: #DCE4FA; --pt: #3150B8; }
.tt-p3 { --pb: #FDF4EA; --ph: #F8E2CB; --pt: #A0561A; }
.tt-p4 { --pb: #F6F1FC; --ph: #E8DDF7; --pt: #6A44A8; }
.tt-week tr[class*="tt-p"] > td, .tt-dayt tr[class*="tt-p"] > td { background: var(--pb); }
.tt-week tr[class*="tt-p"] > td.today { background: linear-gradient(rgba(23,163,141,.07), rgba(23,163,141,.07)), var(--pb); box-shadow: inset 2px 0 0 rgba(23,163,141,.35), inset -2px 0 0 rgba(23,163,141,.35); }
.tt-week tr[class*="tt-p"] > th.tt-rh, .tt-dayt tr[class*="tt-p"] > th.tt-rh { background: var(--ph) !important; }
tr[class*="tt-p"] > th.tt-rh span { color: var(--pt); display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
tr[class*="tt-p"] > th.tt-rh span small { font-size: 10.5px; font-weight: 800; opacity: .75; margin-top: 2px; }
.tt-week tr[class*="tt-p"] + tr[class*="tt-p"] > td, .tt-week tr[class*="tt-p"] + tr[class*="tt-p"] > th,
.tt-dayt tr[class*="tt-p"] + tr[class*="tt-p"] > td, .tt-dayt tr[class*="tt-p"] + tr[class*="tt-p"] > th { border-top: 2px solid #fff; }
.tt-mrow[class*="tt-p"] { background: var(--pb); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.tt-mrow[class*="tt-p"] h3 { color: var(--pt); }

/* 출석부 카드 (이름 두 번 누르기) */
.rbc-back { position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; z-index: 400; background: rgba(20,24,23,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rbc-box { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: 100%; max-width: 1240px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.rbc-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.rbc-head b { font-size: 18px; margin-right: 6px; }
.rbc-x { margin-left: auto; border: 0; background: #F1F3F2; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.rbc-body { overflow: auto; padding: 12px 18px 18px; }
/* 초대 링크로 연 신규 등록(학부모): 메뉴 · 로그인 단추 숨김 */
body.page-inv .mainnav, body.page-inv .topbar-right, body.page-inv .brand-sub, body.page-inv .subbar, body.page-inv .subbar2 { display: none !important; }
/* 체험 후 메모 기록 (메모 창 아래) */
.tm-hist:empty { display: none; }
.tm-hist { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tm-hist > b { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.tm-hist ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.tm-hist li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.tm-hist li:last-child { border-bottom: 0; }
.tm-hist li small { display: block; font-size: 11.5px; color: var(--faint); }
.tm-hist li span { display: block; margin-top: 2px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.tm-hist li .tm-del { color: var(--faint); font-style: italic; }
.tm-hist ins { text-decoration: none; background: #D9F7DF; color: #0E6B2C; border-radius: 3px; padding: 0 2px; }
.tm-hist del { background: #FDE4E4; color: #B0171D; border-radius: 3px; padding: 0 2px; }
.tm-hist li span i { font-style: normal; color: var(--faint); }
.tm-hist .tm-k { font-style: normal; font-size: 11px; font-weight: 800; color: #0E7A66; background: var(--mint-l); border-radius: 99px; padding: 1px 7px; margin-right: 6px; }
.rbc-wait { color: var(--muted); font-size: 14px; }
.rbc-meta { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.rbc-sec + .rbc-sec { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.rbc-scroll { overflow-x: auto; }
.rbc-t { border-collapse: collapse; table-layout: fixed; font-size: 12.5px; color: var(--text); }
.rbc-t td { border: 1px solid #D9DEDC; padding: 2px 4px; text-align: center; vertical-align: middle; white-space: pre-line; word-break: keep-all; overflow: hidden; }
.rbc-t td.o { color: #0E7A66; font-weight: 800; background: #EEF8F5; }
.rbc-t td.x { color: #C0171E; font-weight: 800; background: #FDEEEE; }
.rbc-t td.xo { color: #A0561A; font-weight: 800; background: #FDF4EA; }
.rbc-t td.note { box-shadow: inset -7px 7px 0 -4px #EB2027; cursor: help; }
.rbc-notes { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.rbc-notes b { color: #C0171E; font-size: 11px; margin-right: 4px; }

.rbc-open { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rbc-open a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.rbc-open a b { margin-left: auto; color: var(--mint-d); font-size: 13px; }
.rbc-open a:hover { background: #F4FBFA; }

.topbar-right .who small { font-size: 11px; font-weight: 600; opacity: .75; margin-left: 2px; }

/* 옛 사파리(14.1 미만, 맥미니 Safari 13)는 aspect-ratio 를 몰라서 썸네일 칸 높이가 제각각 → assets/ratio.js 가 칸 높이를 가로×3/4 로 직접 맞춤 */


/* 결석: 이름표(배경·아이콘) 없이 이름 위에 굵은 빨간 줄만 */
.nm.ab { background: none !important; box-shadow: none !important; padding: 0 1px !important; color: inherit; font-weight: inherit; font-size: inherit;
  text-decoration: line-through; -webkit-text-decoration-line: line-through; text-decoration-color: #E0161D; -webkit-text-decoration-color: #E0161D; text-decoration-thickness: 3px; }
.nm.ab i { display: none !important; }
.tt-legend .nm.ab { color: var(--text); text-decoration: line-through; text-decoration-color: #E0161D; text-decoration-thickness: 3px; font-weight: 700; }
body.tt-fit #ttBody .nm.ab { font-size: inherit; text-decoration-thickness: 0.14em; }
/* 결석: 빨간 두 줄 */
.nm.ab, .tt-legend .nm.ab { text-decoration-style: double; -webkit-text-decoration-style: double; text-decoration-thickness: 2px; }
body.tt-fit #ttBody .nm.ab { text-decoration-thickness: 0.09em; }
/* 결석: 두 줄을 더 굵게 */
.nm.ab, .tt-legend .nm.ab { text-decoration-thickness: 3.5px; }
body.tt-fit #ttBody .nm.ab { text-decoration-thickness: 0.15em; }
/* 결석: 글자 위에 또렷한 빨간 두 줄 (취소선 대신 덧그린 줄 — 두 줄 간격이 잘 보이게) */
.nm.ab, .tt-legend .nm.ab { position: relative; text-decoration: none !important; -webkit-text-decoration-line: none !important; }
.nm.ab::after { content: ""; position: absolute; left: -1px; right: -1px; top: 50%; height: 0.5em; margin-top: -0.3em; border-top: 0.2em solid #E0161D; border-bottom: 0.2em solid #E0161D; pointer-events: none; }

/* 조립도 순서 편집 (관리자) */
.ord-bar { margin: 4px 0 14px; padding: 10px 14px; border-radius: 12px; background: #FFF6DD; border: 1px solid #F3D88A; color: #6B4E00; font-size: 13.5px; }
.ord-bar b { margin-right: 8px; }
body.order-edit .card { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; outline: 2px dashed rgba(23,170,157,.35); outline-offset: -2px; }
body.order-edit .card:hover .thumb img { transform: none; }
body.order-edit .card.dragging { opacity: .45; outline: 2px solid var(--mint); cursor: grabbing; }
.ord-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1F2423; color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 700; opacity: 0; transition: all .2s; z-index: 500; pointer-events: none; }
.ord-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ord-toast.bad { background: #C0171E; }

/* 관리자: 다른 모드로 보기 */
.viewas { display: inline-flex; align-items: center; background: #F1F3F2; border-radius: 99px; padding: 3px; margin-right: 6px; font-size: 12.5px; }
.viewas > span { padding: 0 8px 0 10px; color: var(--faint); font-weight: 700; }
.viewas a { padding: 5px 11px; border-radius: 99px; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.viewas a.on { background: #1F2423; color: #fff; }
body.viewing-as .topbar { box-shadow: inset 0 -3px 0 #F0B429; }
@media (max-width: 700px) { .viewas > span { display: none; } .viewas a { padding: 5px 8px; } }

/* 학생 이름 찾기: "주간 시간표" 제목 옆 (꽉 채우기 버튼이 있으면 그 오른쪽), 꽉 채우기 중엔 나가기 왼쪽 */
.tt-titlerow .tt-search { width: 230px; height: 38px; margin: 0; }
.tt-titlerow .tt-search input { font-size: 14px; }
body.tt-fit .tt-weeknav .tt-search { width: 190px; height: 32px; flex: none; margin: 0 6px 0 auto; }
body.tt-fit .tt-weeknav .tt-search + .tt-fitbtn { margin-left: 0; }
@media (max-width: 700px) { .tt-titlerow .tt-search { width: 100%; } }

.tt-rbsync { margin-left: 8px; border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 3px 11px; font-size: 12.5px; font-weight: 700; color: var(--mint-d); cursor: pointer; }
.tt-rbsync:hover { background: #F4FBFA; }
.tt-rbsync:disabled { opacity: .55; cursor: default; }
.tt-rbsync-msg { margin-left: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- PDF 인쇄용 (schedule.php?print=1 — NAS PDF 변환기가 1920×1080 꽉 채우기 모양으로 찍음) ---------- */
body.tt-print.tt-fit { overflow: visible; width: 1920px; min-width: 1920px; background: #fff; }
body.tt-print.tt-fit main.wrap { width: 1920px; max-width: none; padding: 14px 16px 16px; }
body.tt-print .tt-tools, body.tt-print .tt-fitbtn, body.tt-print .tt-search, body.tt-print #wkPrev, body.tt-print #wkNow, body.tt-print #wkNext,
body.tt-print .tt-live, body.tt-print .tt-days, body.tt-print .tt-tip, body.tt-print .tt-rbsync, body.tt-print .warnbar, body.tt-print .subbar { display: none !important; }
body.tt-print .tt-fitlabel { font-size: 22px; }
body.tt-print .tt-fitlabel::before { content: '주간 시간표 · '; }
body.tt-print.tt-fit #ttUnplaced { max-height: none; overflow: visible; margin-top: 12px; }
body.tt-print #ttUnplaced summary { list-style: none; pointer-events: none; }
body.tt-print #ttUnplaced summary::-webkit-details-marker { display: none; }
body.tt-fit .tt-archbtn { display: none; }   /* 꽉 채우기·PDF에서는 보관함 버튼 숨김 */

/* 선생님: 조립도 등록 버튼은 '조립도 라이브러리' 제목 옆 */
.lib-head h1 .lib-add { margin-left: 12px; vertical-align: middle; position: relative; top: -3px; letter-spacing: 0; }
/* 작은 화면: 위쪽 메뉴는 좌우로만 스크롤 (위아래로 끌리거나 튀지 않게) */
.mainnav { overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x; flex-wrap: nowrap; align-items: center; align-self: stretch; }
.mainnav a, .mainnav .soon { flex: none; }
@media (max-width: 640px) {
  .topbar-in { overflow: hidden; }
  .mainnav a, .mainnav .soon { padding: 8px 10px; }
  .lib-head h1 .lib-add { top: -2px; margin-left: 8px; }
}
/* 휴대폰: MODE(보기 모드) 버튼은 메뉴 아래 줄로 내려서 메뉴 자리를 넓힘 */
@media (max-width: 640px) {
  .topbar-in { height: auto; min-height: 58px; flex-wrap: wrap; }
  .topbar-in > .brand, .topbar-in > .mainnav { height: 58px; display: flex; align-items: center; }
  .topbar-right { display: contents; }
  .topbar-right > * { -webkit-box-ordinal-group: 3; order: 2; }
  .topbar-in > .mainnav { flex: 1 1 0%; min-width: 0; }
  .topbar-right > .viewas { order: 3; -webkit-box-ordinal-group: 4; flex: 0 0 100%; width: 100%; justify-content: center; margin: 0 0 8px; box-sizing: border-box; }
  .viewas > span { display: inline; padding: 0 8px 0 10px; }
  .viewas a { padding: 5px 14px; }
}

/* 예정된 시간 변경 미리 보기 (그 주부터 새 반에 보임) */
.nm.mv { padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; background: #EEE8FB; color: #4B2E9A; box-shadow: inset 0 0 0 1.5px #7B5CD6; }
.nm.mv i { background: #7B5CD6; }
.tt-legend .nm.mv { display: inline-flex; padding: 1px 9px; border-radius: 99px; font-size: 12px; }
.tt-dayt .tt-names .nm.mv { align-self: flex-start; }

/* 정규반이 아닌 임시 체험반 (선생님 공강 교시에 체험 일정만 있을 때) — 점선 테두리 + 옅은 빗금 + "임시 · 체험" 꼬리표 */
.tt-card.is-temp { border: 2px dashed #22A447; border-left-width: 4px; border-left-style: dashed;
  background: repeating-linear-gradient(135deg, #F4FBF5 0 8px, #FFFFFF 8px 16px); }
.tt-card.is-temp .tt-code { opacity: .75; }
.tt-part.is-temp { outline: 2px dashed #22A447; outline-offset: -2px; border-radius: 8px; background: repeating-linear-gradient(135deg, #F4FBF5 0 8px, transparent 8px 16px); }
.tt-temp { font-size: 10.5px; font-weight: 900; color: #146C2E; background: #fff; border: 1.5px dashed #22A447; padding: 0 6px; border-radius: 99px; line-height: 1.5; white-space: nowrap; }
.tt-legend .tt-temp.lg { font-size: 12px; padding: 1px 9px; display: inline-flex; align-items: center; }

/* 설정: 두 번째 줄 (고른 묶음의 항목) */
.subbar2 { background: #EEF2F1; border-bottom: 1px solid var(--line); }
.subbar2-in { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 42px; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subbar2 a { color: #3B4744; font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 7px; white-space: nowrap; text-decoration: none; }
.subbar2 a:hover { background: rgba(0, 0, 0, .05); }
.subbar2 a.on { background: #fff; color: #0E7A66; box-shadow: 0 0 0 1px #CBD5D1; }
@media (max-width: 720px) { .subbar2-in { padding: 0 16px; } }
/* 학생관리 탭 묶음 */
.mk-tabs .mk-tg { display: inline-flex; align-items: center; flex-wrap: wrap; margin: 0 10px 0 0; }
.mk-tabs .mk-tg > b { font-size: 12px; color: var(--faint); font-weight: 800; margin: 0 2px 0 6px; letter-spacing: .04em; }
.mk-tabs .mk-tg + .mk-tg { border-left: 1px solid var(--line-2); padding-left: 8px; }

/* 체험 접수: 결제 표시 (이름 뒤 작은 꼬리표) */
.nm .tr-pd { font-style: normal; font-size: 10px; font-weight: 900; margin-left: 4px; padding: 0 5px; border-radius: 6px; line-height: 15px; background: #FDECEC; color: #B0171D; }
.nm .tr-pd.ok { background: #146C2E; color: #fff; }

/* ============================================================================
 * 휴대폰(640px 이하): 좌우 스크롤 없애기 — 2026-11 모바일 정리
 * ========================================================================== */
/* 긴 경로 · 오류 글자가 칸을 밀어내지 않게 (넘칠 때만 줄바꿈) */
.panel, .notice, .hint, .warnbar { overflow-wrap: break-word; word-wrap: break-word; }
@media (max-width: 640px) {
  /* 위 메뉴: 로고 · 로그아웃 아래 한 줄 전체에 나눠 담음 (밀어서 보던 것 → 한눈에) */
  .topbar-in > .brand { -webkit-box-ordinal-group: 1; order: 0; }
  .topbar-right > * { -webkit-box-ordinal-group: 2; order: 1; }
  .topbar-right > .btn-keep, .topbar-right > .login-link { margin-left: auto; }
  .topbar-in > .mainnav { -webkit-box-ordinal-group: 3; order: 2; flex: 0 0 100%; width: 100%; height: auto; min-height: 0; overflow: visible; touch-action: auto; flex-wrap: wrap; justify-content: space-between; padding: 0 0 4px; margin-top: -6px; }
  .mainnav a, .mainnav .soon { flex: 1 1 auto; text-align: center; padding: 8px 4px; font-size: 14px; }
  .mainnav a.on::after { bottom: 0; left: 10px; right: 10px; }
  .topbar-right > .viewas { -webkit-box-ordinal-group: 4; order: 3; }

  /* 위쪽 메뉴는 모든 화면에서 고정 (시간표 · 조립도와 같게, 2026-11-13) */
  /* 위로 올리면 로고 · 로그아웃 줄(58px)은 사라지고 메뉴 줄만 남음 */
  .topbar { top: -58px; }

  /* 설정 메뉴 두 줄: 넘치면 다음 줄로 (밀어서 보던 것 → 한눈에) */
  .subbar-in, .subbar2-in { height: auto; min-height: 0; flex-wrap: wrap; overflow: visible; padding-top: 5px; padding-bottom: 5px; }
  .subbar-title, .subbar a.right { display: none; }
  .subbar a { flex: 1 1 auto; text-align: center; padding: 6px 6px; margin: 1px; font-size: 13px; }
  .subbar2 a { padding: 6px 10px; margin: 1px; font-size: 13px; }

  /* 표 → 카드: 한 줄이 카드 한 장, 칸마다 제목(data-label)을 앞에 붙임 (page_foot 의 스크립트가 붙임) */
  table.stk-on, table.stk-on > tbody, table.stk-on > tbody > tr, table.stk-on > tbody > tr > td, table.stk-on > tbody > tr > th { display: block; width: auto !important; max-width: 100%; }
  table.stk-on { border: 0 !important; background: none !important; }
  table.stk-on > tbody > tr.stk-h { display: none; }
  table.stk-on > tbody > tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; background: #fff; }
  table.stk-on > tbody > tr > td, table.stk-on > tbody > tr > th { border: 0 !important; padding: 4px 0 !important; text-align: left !important; white-space: normal !important; overflow-wrap: break-word; word-wrap: break-word; }
  table.stk-on > tbody > tr > td:empty { display: none; }
  table.stk-on > tbody > tr > td[data-label] { position: relative; padding-left: 84px !important; min-height: 26px; }   /* 제목은 왼쪽에 고정, 내용은 오른쪽 열에 가지런히 (여러 줄이어도) */
  table.stk-on > tbody > tr > td[data-label]:before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: 76px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.35; }
  table.stk-on input, table.stk-on select, table.stk-on textarea { max-width: 100%; }

  /* 시리즈 · 컬렉션: 이름 칸은 한 줄 넓게, 순서 · 개수 · 저장 · 삭제는 다음 줄로 (삭제 버튼이 잘려 안 보이던 것) */
  .cat-row { flex-wrap: wrap; padding: 10px 12px; }
  .cat-row .nm { flex: 1 1 220px; min-width: 0; }
  .cat-row .ord { margin-left: auto; }
  .cat-cols .cat-row { padding-left: 22px; }

  /* 그 밖에 넘치기 쉬운 것 */
  main.wrap pre, main.wrap code { white-space: pre-wrap; word-break: break-all; }
  main.wrap input, main.wrap select, main.wrap textarea { max-width: 100%; }
}

/* 아이패드 양식(신규 등록 admin/register.php · 체험 접수 admin/trial.php): 아이폰에서도 좌우 스크롤 없게
 *  본문이 margin:auto 라 내용 폭에 맞춰지는데, 생년월일 · 출생년도 선택 칸이 가장 긴 항목 폭보다 줄지 않아 화면을 밀었음 */
main.rg { width: 100%; min-width: 0; }
.rg select, .rg input, .rg textarea { min-width: 0; max-width: 100%; }
.rg-birth select { flex: 1 1 0%; min-width: 0; }
@media (max-width: 640px) {
  /* 체험 접수: 주 넘기기 줄 (← 이전 주 · 날짜 · 다음 주 →) 이 아이폰 폭에 들어가게 */
  .tr-wkbar { padding: 6px; }
  .tr-wkbar b { font-size: 14px; text-align: center; flex: 1 1 auto; min-width: 0; }
  .tr-wkbar .btn { padding: 0 10px; font-size: 14px; flex: none; }
  .tr-wkbar span { min-width: 0; }
}

/* ---------- 인쇄 규칙 (모든 화면, 시간표 보관함 인쇄와 같은 모양) — 내용은 inc/layout.php page_foot ----------
 * 화면에서는 숨김. 인쇄할 때 모든 장에 워터마크(CONFIDENTIAL + 인쇄자)와 아래 줄(보안문서 · 인쇄자 · 시각 · 문서 · 반출 금지)
 * position:fixed 라 장마다 되풀이됨. 시간표 보관함(page-arc, 자체 규칙) · NAS 자동 PDF(tt-print) · 회원카드 PDF 만들기(rc-pdf)는 제외 */
.pr-wm, .pr-info { display: none; }
@media print {
  .pr-wm { display: block; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 9998; pointer-events: none; overflow: hidden; }
  .pr-wm-in { position: absolute; left: -30%; top: -40%; width: 160%; height: 180%; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around;
    transform: rotate(-28deg); -webkit-transform: rotate(-28deg); }
  .pr-wm-in span { display: inline-block; width: 25%; text-align: center; padding: 36px 0; font: 900 42px/1 Arial, Helvetica, sans-serif; letter-spacing: .12em; color: rgba(190, 20, 30, .13); }
  .pr-wm-in span small { display: block; font: 700 14px/1.3 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; letter-spacing: 0; margin-top: 6px; color: rgba(190, 20, 30, .18); }
  .pr-info { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; background: #fff; text-align: right; font: 600 9px/1.4 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: #444; padding: 1mm 0 0; border-top: .3mm solid #ddd; }
  .pr-info b { color: #B0171D; }
  .pr-wm, .pr-wm *, .pr-info, .pr-info * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { padding-bottom: 6mm; }   /* 아래 줄이 내용을 가리지 않게 */
  body.page-arc .pr-wm, body.page-arc .pr-info, body.tt-print .pr-wm, body.tt-print .pr-info, body.rc-pdf .pr-wm, body.rc-pdf .pr-info { display: none !important; }
}

/* 신규 등록 학생 (출석부가 _시작대기 — 첫 수업 주부터 "신") — rb_preview_moves 의 slot['nw'] */
.nm.nw { display: inline-flex; align-items: center; gap: 3px; border-radius: 99px; white-space: nowrap; padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; background: #FFF1D6; color: #8A4B00; box-shadow: inset 0 0 0 1.5px #F0A020; }
.nm.nw i { background: #F0A020; }
.tt-legend .nm.nw { padding: 1px 9px; font-size: 12px; }
.tt-dayt .tt-names .nm.nw { align-self: flex-start; }
/* 신규 등록 예정 (반 배정 · 결제 전) — '신'보다 옅게, 점선 */
.nm.ye { display: inline-flex; align-items: center; gap: 3px; border-radius: 99px; white-space: nowrap; padding: 1px 8px 1px 2px; font-weight: 800; font-size: 13px; line-height: 1.5; background: #FFF8EC; color: #9A6A1E; box-shadow: none; outline: 1.5px dashed #E0A040; outline-offset: -1.5px; }
.nm.ye i { background: #E0A040; }
.tt-legend .nm.ye { padding: 1px 9px; font-size: 12px; }
.tt-dayt .tt-names .nm.ye { align-self: flex-start; }

/* 사이트가 바뀌었을 때 입력 중인 화면에 띄우는 안내 (inc/layout.php page_foot) */
.ver-bar { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); -webkit-transform: translateX(-50%); z-index: 4000; max-width: calc(100% - 24px); background: #1E2B27; color: #fff; padding: 9px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.ver-bar button { margin-left: 8px; height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: #14A38B; color: #fff; font-weight: 800; font-family: inherit; cursor: pointer; }
@media print { .ver-bar { display: none !important; } }

/* 위 메뉴 '알림사항' 옆 오늘 알림 수 */
.nav-cnt { display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 5px; border-radius: 99px; background: #E5484D; color: #fff; font-style: normal; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px; }
