/* 학교메이트 전용 (style.css 위에 덮어씀) */

/* 카드 오른쪽 위: 지금 과목 · 강의실 */
#nowInfo { position: absolute; right: 20px; top: 18px; text-align: right; max-width: 150px; }
#nowName { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nowSub { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#phase { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.times .cap { font-size: 12px; }
.earnR .cap { font-size: 12px; white-space: nowrap; }
#runBtn { font-size: 12px; height: 30px; padding: 1px 14px 0; border-radius: 20px; border: 1px solid var(--acc); white-space: nowrap;
  display: inline-flex; align-items: center; -webkit-app-region: no-drag; }
#runBtn.run { background: var(--acc); color: var(--onacc); }
.money small { font-size: 14px; color: var(--sub); margin: 0 6px 0 2px; }

/* 추가 입력 줄 */
.addrow { display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.addrow input, .addrow select { border: 0; min-width: 0; padding: 4px 0; font-size: 13px; }
.addrow input:first-child { flex: 1; }
.addrow input[type=date] { width: 112px; color: var(--sub); }
.addrow input[type=date]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.addrow .short { width: 54px; flex: none; }
.addrow select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; }
.addrow button, .clsForm button { font-size: 12px; height: 26px; padding: 1px 11px 0; border-radius: 8px; background: var(--acc); color: var(--onacc);
  display: inline-flex; align-items: center; flex: none; }

/* D-day 목록 */
.dlist { list-style: none; overflow-y: auto; flex: 1; }
.dlist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dlist li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlist li.done .nm { color: var(--line2); text-decoration: line-through; }
.dlist li.empty { border: 0; justify-content: center; padding: 18px 0; }
.dlist li.pickable { cursor: pointer; } .dlist li.pickable:hover { background: var(--g1); }
.dlist .bx { width: 14px; height: 14px; border: 1.2px solid var(--line2); border-radius: 3px; flex: none; }
.dlist li.done .bx { background: var(--acc); border-color: var(--acc); }
.dlist .del { color: var(--line2); font-size: 11px; }
.pill { font-size: 11.5px; height: 22px; padding: 1px 9px 0; border-radius: 12px; border: 1px solid var(--line2); display: inline-flex; align-items: center; white-space: nowrap; }
.pill.hot { background: var(--acc); border-color: var(--acc); color: var(--onacc); }

/* 시간표 (대학생) */
#p-tt { overflow-y: auto; }
.ttU { display: grid; gap: 3px; }
.tth { text-align: center; font-size: 11.5px; }
.ttHours { position: relative; }
.ttHours span { position: absolute; left: 0; font-size: 10px; color: var(--sub); transform: translateY(-50%); }
.ttCol { position: relative; background: var(--g2); border-radius: 6px; }
.ttCol.today { box-shadow: inset 0 0 0 1px var(--line2); }
.blk { position: absolute; left: 2px; right: 2px; background: var(--g1); border-left: 2px solid var(--acc); border-radius: 4px;
  font-size: 10px; line-height: 1.2; padding: 2px 3px; overflow: hidden; cursor: pointer; word-break: keep-all; }
.blk.arm { background: var(--acc); color: var(--onacc); }
.clsForm { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.clsForm .row { display: flex; gap: 6px; align-items: center; }
.clsForm input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--line); padding: 4px 0; font-size: 13px; }
.clsForm .short { flex: .6; }
.clsForm .days { flex: 1; display: flex; gap: 4px; }
.clsForm .days button { flex: 1; height: 26px; background: transparent; border-radius: 8px; border: 1px solid var(--line); color: var(--sub); font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; padding-top: 1px; }
.clsForm .days button.on { background: var(--acc); border-color: var(--acc); color: var(--onacc); }

/* 시간표 (고등학생) */
.ttH { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.ttH th { font-weight: normal; color: var(--sub); font-size: 11px; }
.ttH th.today, .ttH td.today input { color: var(--ink); }
.ttH tr th:first-child { width: 34px; text-align: left; line-height: 1.1; }
.ttH tr th:first-child small { display: block; font-size: 9px; color: var(--line2); }
.ttH td { background: var(--g2); border-radius: 5px; }
.ttH td.today { background: var(--g1); }
.ttH td input { width: 100%; border: 0; text-align: center; font-size: 12px; padding: 4px 0; color: var(--ink); }
.ttH tr.lunch td { background: none; text-align: center; padding: 1px 0; }
#ttEdit > .cap { margin-top: 6px; }

/* 학점 */
.gpaTop { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 8px; }
.gpaBig { font-size: 26px; } .gpaBig small { font-size: 12px; color: var(--sub); }
.gpaGoal { display: flex; align-items: center; gap: 5px; }
.gpaGoal input { width: 38px; border: 0; border-bottom: 1px solid var(--line2); text-align: center; padding: 2px 0; }

/* 오늘 계획 (할 일과 같은 모양) */
#planForm input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 4px 0 8px; }
#planList { list-style: none; overflow-y: auto; flex: 1; }
#planList li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
#planList li span { flex: 1; word-break: break-all; }
#planList li.done span { color: var(--line2); text-decoration: line-through; }
#planList .bx { width: 14px; height: 14px; border: 1.2px solid var(--line2); border-radius: 3px; flex: none; }
#planList li.done .bx { background: var(--acc); border-color: var(--acc); }
#planList .del { color: var(--line2); font-size: 11px; }
#planCount { text-align: right; padding-top: 4px; }

/* 급식 */
.mealHead { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mealHead button { width: 22px; color: var(--sub); font-size: 16px; }
#mealSchool { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
#mealSchool button { color: var(--sub); text-decoration: underline; margin-left: 4px; }
#mealBody { overflow-y: auto; flex: 1; padding-top: 8px; }
#mealBody .empty { text-align: center; padding: 18px 0; }
.meal { line-height: 1.75; padding-bottom: 10px; }
.meal .sh { font-size: 13px; color: var(--sub); }

/* 처음 실행: 학생 고르기 */
#pick { top: 10px; justify-content: center; }
.pickIn { display: flex; flex-direction: column; gap: 10px; }
.pickIn .sh { font-size: 20px; }
.pickBtn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; border: 1px solid var(--line2);
  border-radius: 14px; text-align: left; }
.pickBtn b { font-weight: normal; font-size: 17px; }
.pickBtn:hover { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); }

/* 설정 3칸 줄 */
#setHigh .row label { font-size: 11px; }

/* 학생을 고르기 전에는 카드·탭 숨기기 */
body:not([data-mode]) #card, body:not([data-mode]) #body { visibility: hidden; }

#goTT { font-size: 22px; padding: 2px 0; border-bottom: 1.5px solid var(--acc); -webkit-app-region: no-drag; }

#yajaMore { display: flex; flex-direction: column; gap: 8px; }
#sYDays button { height: 28px; }

/* 캐릭터 크기 맞추기: 높이를 똑같이 두고 가로는 그림 비율대로 */
.chars button .pic { width: 100%; height: 42px; }
.chars button .pic img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
#walker img { object-position: 50% 100%; }

/* 교시 시간 미리보기: 한 줄에 한 교시 */
#periodPreview { padding: 10px 14px; }
.pgrid { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 3px; font-size: 13px; line-height: 1.5; }
.pgrid .pn { color: var(--sub); }
.pgrid .lunch { color: var(--ink); border-top: 1px dashed var(--line2); border-bottom: 1px dashed var(--line2); padding: 2px 0; }

/* 야자: 켜기 버튼 · 요일 · 시간 사이 간격 */
#yajaMore { margin-top: 10px; gap: 12px; }
#setHigh .sh, #setUni .sh { margin-top: 10px; }
#setHigh, #setUni { display: flex; flex-direction: column; gap: 10px; }

/* 시간 글자가 없을 때도 출근선과 아래 구분선 사이 간격 유지 */
.times { min-height: 19px; }
.earn { border-top: 0; margin-top: 10px; padding-top: 4px; }
.blk.sel { background: var(--acc); color: var(--onacc); }
.editBtns { justify-content: flex-end; gap: 6px; }
.clsForm .editBtns button.ghost { background: transparent; color: var(--sub); border: 1px solid var(--line2); }
.clsForm .editBtns button.arm { color: var(--ink); border-color: var(--ink); }
.dlist .nm { cursor: pointer; }
.dlist li.sel { background: var(--g1); border-radius: 8px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.dlist li.sel .nm { text-decoration: underline; text-underline-offset: 3px; }
.addrow button.cx { background: transparent; color: var(--sub); border: 1px solid var(--line2); }
.fontprev { padding: 5px 10px; font-size: 13px; border-radius: 8px; margin-top: -2px; }
.ttHours span:last-child { transform: translateY(-100%); }

/* ═════════ 웹(아이패드 · 브라우저)에서 열었을 때 ═════════ */
html.web, html.web body { background: var(--g2, #f2f2f0); }
html.web body { display: flex; justify-content: center; align-items: flex-start; min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
html.web #app { width: min(100vw, 420px); height: 100dvh; max-height: 100dvh; border-radius: 0; }
html.web #btnClose, html.web #btnPin, html.web #edgeTab, html.web #autoRow { display: none !important; }
html.web body.folded #app { height: auto; }
/* 아이패드처럼 화면이 크면 크게 */
@media (min-width: 700px) and (min-height: 700px) {
  html.web body { align-items: center; }
  html.web #app { zoom: 1.45; height: min(calc(100dvh / 1.45 - 24px), 680px); border-radius: 22px; box-shadow: 0 10px 40px #0000001a; }
}
@media (min-width: 1000px) and (min-height: 900px) { html.web #app { zoom: 1.7; height: min(calc(100dvh / 1.7 - 24px), 700px); } }

/* 걷는 캐릭터: 컷을 겹쳐 두고 보이는 것만 바꾸기 */
#walker { }
#walker .wf { position: absolute; inset: 0; opacity: 0; }
#walker .wf.on { opacity: 1; }
#walker.step { animation-duration: 2.4s; }
@keyframes step { 50% { transform: translateY(-1.5px); } }
