/* ═══════════ 모바일 · 상담 화면 — 상담 관리 · 상담 진행 · 녹음 바 · AI 결과 리포트 · 상담 일정 · CARE-8 · 로그인 ═══════════
   읽는 순서: app.css → rt.css → app-extra.css → m-shell.css → m-students.css → m-counsel.css(이 파일) → landing.css
   구간: 좁은 화면(compact) ≤ 900px · 휴대폰(phone) ≤ 600px. 데스크톱(900px 초과)은 지금 모양 그대로 — 새 규칙은 미디어 쿼리 안에.
   예외(데스크톱에서 보이는 모양은 그대로): ① 새로 만든 요소를 숨기거나 레이아웃에서 빼는 규칙(달력 점 · 일정 목록 · 리포트 단추 묶음 등)
   ② 로그인 화면의 span → button 바꾼 링크가 예전 글자 모양 그대로 보이게 하는 초기화.
   공용 도구(--appbar-h · .m-fixbar · 시트 · 필터 접기 · 입력 칸 16px/44px)는 m-shell.css 것을 쓴다. */

/* ── 데스크톱에서 숨는(또는 상자 없는) 새 요소 ── */
.ract-main{display:contents}                       /* 리포트 주요 단추 묶음(900px 이하에서 화면 아래 고정 막대) */
.cal-dots,.cdsel,.cal-agenda,.why-m{display:none}  /* 상담 일정 점 · 날짜 고르기 단추 · 고른 날 일정 목록 · 상담 관리 카드의 실패 사유 전문 */
/* 로그인: 링크(span)를 단추(button)로 바꿨다(키보드로도 누르게) — 데스크톱에서 예전 글자 링크 모양 그대로.
   :where() 로 우선순위를 낮춰 m-shell.css 의 휴대폰 규칙(.lg-opt .lnk 여백 등)이 이긴다 */
:where(#login) button.lg-back,:where(#login) button.lnk{border:0;background:none;padding:0;text-align:left}

/* ═══════════ 900px 이하(태블릿 세로 · 휴대폰) ═══════════ */
@media (max-width:900px){

  /* ── 상담 진행: 한 열 — 학생 머리 → 상담 정보 → 이전 계획 → 성적 추세 → CARE-8 레이더 → 설문 → 공통 질문 → [다음 상담 예약 · 상담 종료]
     (.crun-main 을 상자 없이 펼쳐 같은 열의 항목으로 — 순서만 CSS order 로, DOM · id 는 그대로) ── */
  .crun-grid{display:flex;flex-direction:column;align-items:stretch;gap:12px}
  .crun-main{display:contents}
  .crun-grid .card.sec{margin-top:0}
  .crun-left{order:1;position:static}
  .crun-main>:nth-child(n+5){order:2}                 /* 설문 · 공통 질문 · 종료 단추 */
  .crun-main>.savebar{margin-top:4px}
  .radar-card svg{max-width:340px;margin:0 auto}
  .rs{min-height:34px}
  /* CARE-8 요약: 긴 응답 값은 잘라 두지 않고 줄을 바꿔 다 보인다(마우스를 올려야 보이던 title 대신) */
  .rs .v{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.45;word-break:keep-all;overflow-wrap:anywhere}

  /* 학생 머리: 앱 바 바로 아래에 붙는 작은 머리(120px 이하) — 지난 CARE-8 칩은 옆으로 밀어 보는 한 줄 */
  .crun-stu{position:sticky;top:var(--appbar-h,56px);z-index:20;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:10px 14px;
    box-shadow:0 6px 16px rgba(20,30,50,.08)}
  .crun-stu .ava{width:36px;height:36px}
  .cs-main{flex:1 1 0;min-width:0}
  .cs-name{font-size:16px;line-height:1.35}
  .cs-meta{margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
  .cs-care{flex:1 1 100%;display:flex;align-items:center;gap:8px;min-width:0;max-width:none;margin:0;text-align:left}
  .cs-lb{flex:none;margin:0;white-space:nowrap}
  .cs-care .pillset{flex:1 1 auto;min-width:0;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;padding:1px 18px 1px 0;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 22px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 22px),transparent)}
  .cs-care .pillset::-webkit-scrollbar{display:none}
  .cs-care .pillset>*{flex:none}

  /* 상담 정보 · 이전 계획 · 성적 추세 · 설문 머리의 단추 */
  .ci-grid .seg2 button{min-height:44px}
  #planOpen,#printBtn{min-height:44px}
  #crunView .chart-head{flex-wrap:wrap;row-gap:8px}
  #crunView .chart-head .seg button{min-height:44px;min-width:44px}

  /* CARE-8 설문: 응답 단추 44px · 상담 질문 접기 줄 44px */
  .lvb2 button{min-height:44px}
  .tpv{height:44px}
  .qg-h{min-height:44px}
  .acc-h{min-height:48px}
  .fqo{min-height:44px}
  .tact .btn{min-height:44px;padding:0 16px;font-size:14px}   /* 응답 팝업 [미입력] · [확인](.btn.sm 12.5px) */

  /* 글자 대비 4.5:1 이상(흰 바탕) — 응답 전 '선택' · 팝업 '미입력' · 고른 '보통' · 여러 개 선택 안내 */
  .tpv.empty{color:#5f6b7d}
  .fqo.mu{color:#5f6b7d}
  .fqhint{font-size:13px;color:#5f6b7d}
  .lvb2 button.g2.on{background:#9a6a0e;border-color:#9a6a0e}
  /* 작은 글씨: 보조 글 13px 이상(배지 · 칩 수는 12px 그대로) */
  .rlg,.pv,.qk,.cs-lb{font-size:13px}
  .rinfo span{font-size:13px}
  .aunote2{font-size:13px}
  .skpi em,.cal-lg,.cal-wd div{font-size:13px}
  /* 설문 요소 머리의 '지난 상담 · 이번 상담' · 상담 질문 소제목(현재 상태 · 원인 파악) · 응답 팝업 시간 단위 · 달력 날짜 · 일정 창 항목 이름 ·
     상담 관리 상태 탭의 건수(데스크톱 12~12.5px) */
  .sv-h .r,#svMount .qg .qg-t,.tpop .tu,.cdn,.evinfo span,#clTabs button span{font-size:13px}

  /* ── 녹음 바: 화면 맨 아래 전체 폭(안전 영역 위) · 단추 44px ── */
  #recBar{left:0;right:0;bottom:0;transform:none;width:auto;max-width:none}
  .rb-in{justify-content:center;flex-wrap:wrap;column-gap:12px;row-gap:4px;border-radius:0;
    padding:8px max(12px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));
    box-shadow:0 -8px 24px rgba(15,25,45,.22)}
  .rb-in>.rb-btn:first-child,.rb-in>.rb-btn:last-child{margin:0}
  .rb-btn,.rb-stop{min-height:44px;padding:0 18px;font-size:14px}
  .rb-in .lb{font-size:13px;color:#c4cede;white-space:normal;text-align:center}
  #crunView.show{padding-bottom:40px}
  /* 상담 진행(녹음 바가 떠 있음): 알림은 화면 위(앱 바 바로 아래)에 — 아래쪽은 녹음 바 · 응답 시트 · 맨 끝 [다음 상담 예약] [상담 종료]가
     차지해 아래에 띄우면 그 단추와 응답 항목을 가렸다. bottom:auto 는 !important — 입력 창 단추 줄 위로 올리는 규칙(m-shell.css)이
     bottom 을 다시 주면 top · bottom 이 함께 잡혀 알림이 늘어난다 */
  body:has(#recBar.show) #toast{top:calc(var(--appbar-h,56px) + 8px);bottom:auto!important}
  @media (max-width:760px){
    /* 760px 이하(app.css 와 같은 경계): 상태 · 단추 한 줄 + 녹음 개수 · 용량 아랫줄 */
    .rb-in{column-gap:10px}
    .rb-in .lb{order:9;flex-basis:100%;line-height:1.35}
    .rb-t{min-width:0}
    #crunView.show{padding-bottom:64px}
  }

  /* ── AI 결과 리포트: 주요 단추는 화면 아래 고정 막대(.ract-main.m-fixbar), 머리는 이름 · 상태만 ── */
  #crepView .dhead{gap:8px 14px}
  #rActs{display:contents}
  #repKind{flex:1 1 100%;display:flex}
  #repKind button{flex:1;min-height:44px}
  .ract-main{display:flex}
  .ract-main .btn{flex:1 1 0;min-width:0;max-width:240px;min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:4px;
    padding:6px 10px;font-size:14px;line-height:1.25;white-space:normal;text-align:center;word-break:keep-all}
  .ract-main{justify-content:center}
  #repRegen{flex-direction:column;gap:0}
  #repRegen .tiny2{font-size:13px;line-height:1.2}
  #crepView.show{padding-bottom:calc(40px + env(safe-area-inset-bottom,0px))}
  body:has(#crepView.show .ract-main) #toast{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  /* 떠 있는 [크게 보기](#repFit · 아래 80~124px)가 보이면 알림은 그 위에 — 알림이 단추를 덮지 않게 */
  body:has(#crepView.show #repFit:not([hidden])) #toast{bottom:calc(136px + env(safe-area-inset-bottom,0px))}
  #rMeta .tiny2{word-break:keep-all}
  /* A4 쪽: 화면 너비에 맞게 줄여 보인다(app-report.js 가 --rp-z 계산 · 핀치 확대 가능). [크게 보기]는 화면 오른쪽 아래 떠 있는 단추 */
  #repMount.fit .rp-page{zoom:var(--rp-z,1)}
  #repMount .rp-ed{scroll-margin:0 16px}   /* 문장을 눌러 원래 크기로 바뀔 때 왼쪽에 조금 여백을 두고 맞춘다 */
  #repMount.fit{padding:14px 0 20px;gap:14px}
  #repFit:not([hidden]){position:fixed;right:max(12px,env(safe-area-inset-right,0px));bottom:calc(80px + env(safe-area-inset-bottom,0px));z-index:141;
    display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 16px;border-radius:999px;border-color:#16223a;background:#16223a;color:#fff;
    font-size:14px;box-shadow:0 8px 22px rgba(20,30,50,.28)}
  #repFit svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  body.nav-open #repFit{visibility:hidden}

  /* ── 상담 일정(601~900px 는 지금 달력 · 누르는 칸만 키움) ── */
  .cal-head{flex-wrap:wrap}
  #calPrev,#calNext{width:44px;height:44px;flex:none}
  #calToday{min-width:56px;min-height:44px}
  .cal-head .sel{min-height:44px}
  .cev{min-height:44px;font-size:13px;white-space:normal;line-height:1.3;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  .cal-lg{flex-wrap:wrap;gap:6px 14px}
  .cal-lg span{white-space:nowrap}
  .skpi span,.skpi em{word-break:keep-all}

  /* ── CARE-8(학습 변인): 요소 목록은 위에 붙는 칩 한 줄(옆으로 밀기), 본문은 전체 폭 ── */
  .cbk-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .cbk-side{display:contents}
  .cbk-side .search input{width:100%}
  #cbkNav{position:sticky;top:var(--appbar-h,56px);z-index:30;margin:0 calc(-1 * var(--m-gr,16px)) 0 calc(-1 * var(--m-gl,16px));
    display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;
    padding:8px var(--m-gr,16px) 8px var(--m-gl,16px);background:var(--bg);border-bottom:1px solid var(--line)}
  #cbkNav::-webkit-scrollbar{display:none}
  #cbkNav .cbk-gl{display:none}
  #cbkNav button{flex:none;min-height:44px;padding:0 14px 0 10px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:14px;white-space:nowrap}
  #cbkNav .nodata{padding:10px 4px}
  .cbk-tabs .tab{min-height:44px}
  .cbk-crit div{word-break:keep-all}

  /* ── 로그인 · 계정 · 개인정보처리방침(셸 m-shell.css 위에 남은 것) — 태블릿(601~900px)도 누르는 곳 44px ── */
  #login button.lg-back:focus-visible,#login button.lnk:focus-visible{outline:2.5px solid #8fb6ea;outline-offset:2px;border-radius:6px}
  #login .lg-opt .lnk,#login .lg-links .lnk{display:inline-flex;align-items:center;min-height:44px;padding:0 6px}
  #login .lg-opt label.fchk{min-height:44px}
  #login .lg-opt{flex-wrap:wrap;row-gap:4px}
  .pol-sec p,.pol-sec ul,.pol-sum{font-size:14px}
  .pol-t{font-size:13.5px}

  /* ── 녹음 파일 창 · 일정 창: 대비 · 크기 ── */
  .recsrc{font-size:12px!important;color:#b23533!important}
  .aurow span{color:#5f6b7d}
  .aurow .lnkbtn{min-height:44px;display:inline-flex;align-items:center}
  .aurow .del{width:44px;height:44px;flex:none}
  /* 녹음 파일 창(900px 이하): 파일 이름 · [삭제]가 첫 줄, 배지 · 용량 · 상태 · [다시 시도]가 다음 줄(이름이 잘리지 않고 [삭제]가 늘 오른쪽 위) */
  .aurow{column-gap:8px;row-gap:6px;padding:6px 6px 10px 12px}
  .aurow>svg{order:0}
  .aurow>b{order:1;flex:1 1 calc(100% - 82px);white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.4}
  .aurow>.del{order:2}
  .aurow>span,.aurow>.lnkbtn{order:3}
  .aurow>.aunote2{flex-basis:100%;padding-left:0}
  .evinfo b,.evinfo span{word-break:keep-all;overflow-wrap:anywhere}
  /* 녹음 안내 글 속 '개인정보처리방침' 링크: 줄 높이는 그대로 두고 누르는 영역만 위아래로 넓힌다 */
  .policy .cplink{display:inline-block;padding:12px 0;margin:-12px 0}
}
/* 가로로 눕힌 휴대폰(높이 500px 이하): 학생 머리는 붙이지 않는다(앱 바 · 녹음 바와 함께 화면을 다 덮지 않게) */
@media (max-width:900px) and (max-height:500px){
  .crun-stu{position:static}
}
/* 아주 좁은 휴대폰(380px 이하): 녹음 바 단추 사이 · 안쪽 여백을 줄여 [이어서 녹음] · [중지]가 한 줄에 */
@media (max-width:380px){
  .rb-in{column-gap:8px}
  .rb-btn,.rb-stop{padding:0 12px}
  .rb-t{font-size:15px}
}

/* 손가락(터치)으로 누르는 좁은 화면: 상담 화면 안 도움말(?) 누르는 영역 44px(셸과 같은 값 — 셸이 바뀌어도 상담 화면은 유지) */
@media (max-width:900px) and (pointer:coarse){
  #crunView .hp::after,#crepView .hp::after,#cbookView .hp::after,#clogView .hp::after{inset:-13px}
}

/* ═══════════ 상담 관리: 상담 이력 표 → 카드(900px 이하 — 휴대폰은 한 줄에 하나, 601~900px 는 두 줄씩) ═══════════
   같은 tr · td 를 CSS 로만 배치한다(id · data-a · data-ck 그대로):
   1줄 [체크] 원생명(퇴원) · 리포트 상태 / 2줄 일시 · 상태 · [예약 변경] / 3줄 학생 번호 · 학교급 · 학교 · 학년 · 반 /
   4줄 방식 · 대상 · 교사 / 5줄 녹음 · [녹음 파일] / 6줄 [상담] [리포트] — 단추 44px, 값이 '-' 뿐인 칸은 숨김.
   가장 중요한 [상담] · [리포트] 단추가 표 맨 오른쪽(가로로 밀어야 보임)에 있던 것을 카드 맨 아래로 */
@media (max-width:900px){
  .tbl-wrap.cltbl{overflow:visible;background:none}
  .cltbl table{display:block;min-width:0;width:100%}
  /* 머리글은 숨기고 '전체 선택'만(app-counsel.js 가 #clCkAll 을 label.ckall 로 감싼다 — 학생 관리와 같은 모양) */
  .cltbl thead{display:block}
  .cltbl thead tr{display:flex;align-items:center}
  .cltbl thead th{display:none}
  .cltbl thead th.ck{display:block;width:auto;padding:0 0 6px;border:0}
  #clogView .ckall{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:0 14px 0 12px;font-size:14px;font-weight:700;color:#3d4a60;cursor:pointer;border-radius:10px}
  #clogView .ckall .rowck{width:20px;height:20px}
  .cltbl tbody{display:block}
  /* 왼쪽 44px(체크 칸 자리)는 카드 안쪽 여백 — 줄이 넘쳐 다음 줄로 가도 글이 체크 칸 오른쪽에 맞춰진다 */
  #clogRows>tr{display:flex;flex-wrap:wrap;align-items:center;column-gap:8px;row-gap:6px;margin:0 0 10px;padding:4px 12px 12px 44px;
    border:1px solid var(--line);border-radius:12px;background:#fff}
  #clogRows>tr::after,#clogRows>tr::before{content:"";flex:0 0 100%;height:0}   /* 줄 바꿈 자리(학교 줄 다음 · 단추 줄 앞) */
  #clogRows>tr::after{order:10}
  #clogRows>tr::before{order:14}
  #clogRows>tr>td{display:block;min-width:0;padding:0;border:0;white-space:normal;overflow-wrap:anywhere;background:none;font-size:14px}
  #clogRows>tr.out{background:#eef0f3}
  #clogRows>tr.out>td{background:none;color:#5f6b7d}
  #clogRows>tr>td:has(>.dash:only-child){display:none}
  #clogRows>tr>td.ck{order:1;flex:0 0 44px;width:44px;height:44px;margin-left:-44px;margin-right:-8px;display:flex;align-items:center;justify-content:center;cursor:pointer}
  #clogRows .rowck{width:20px;height:20px}
  #clogRows>tr>td:nth-child(4){order:2;flex:1 1 0}
  #clogRows .nm.lnk2{display:inline-flex;align-items:center;min-height:44px;min-width:44px;font-size:16px}
  #clogRows>tr>td:nth-child(12){order:3;flex:none}
  #clogRows>tr>td:nth-child(2){order:4;flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:14.5px}
  #clogRows>tr>td:nth-child(2) .sub{margin:0;font-size:14px;color:#3d4a60;font-weight:700}
  #clogRows>tr>td:nth-child(2) .xsbtn{display:inline-flex;align-items:center;justify-content:center;margin:0 0 0 auto;min-height:44px;padding:0 14px;font-size:14px}
  #clogRows>tr>td:nth-child(3){order:5}
  #clogRows>tr>td:nth-child(5){order:6}
  #clogRows>tr>td:nth-child(6){order:7}
  #clogRows>tr>td:nth-child(7){order:8}
  #clogRows>tr>td:nth-child(8){order:9}
  #clogRows>tr>td:is(:nth-child(3),:nth-child(5),:nth-child(6),:nth-child(7),:nth-child(8)){flex:0 1 auto;font-size:13px;color:var(--muted)}
  #clogRows>tr>td:is(:nth-child(5),:nth-child(6),:nth-child(7),:nth-child(8))::before{content:"·";margin-right:8px;color:#98a3b3}
  #clogRows>tr>td:nth-child(7)::after{content:"학년"}
  #clogRows>tr>td:nth-child(7):empty{display:none}
  #clogRows>tr>td:nth-child(9){order:11}
  #clogRows>tr>td:nth-child(9) .sub{display:inline;margin:0;font-size:14px;color:inherit}
  #clogRows>tr>td:nth-child(9) .sub::before{content:" · "}
  #clogRows>tr>td:nth-child(10){order:12}
  #clogRows>tr>td:nth-child(10)::before{content:"· 교사 ";color:var(--muted)}
  #clogRows>tr>td:nth-child(10):empty{display:none}
  #clogRows>tr>td:nth-child(11){order:13;flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
  #clogRows>tr>td:nth-child(11) .audinfo{margin:0;font-size:13px}
  #clogRows>tr>td:nth-child(11) .btn{margin-left:auto;min-height:44px}
  #clogRows>tr>td:is(:nth-child(13),:nth-child(14)){flex:1 1 0;display:flex;flex-direction:column;align-items:stretch;gap:4px}
  #clogRows>tr>td:nth-child(13){order:15}
  #clogRows>tr>td:nth-child(14){order:16}
  #clogRows>tr>td:is(:nth-child(13),:nth-child(14)) .btn{width:100%;min-height:44px;justify-content:center}
  #clogRows>tr>td:is(:nth-child(13),:nth-child(14)) .donechip{justify-content:center;min-height:44px;align-items:center}
  #clogRows .lnkb{display:inline-flex;align-items:center;min-height:40px;font-size:14px}
  #clogRows .sub[title]:not(.why-m){display:none}           /* 잘린 실패 사유(마우스 올려야 전문) 대신 */
  #clogRows .why-m{display:block;font-size:13px;line-height:1.5;color:#b4532a}   /* 전문을 카드에 그대로 */
  #clogRows>tr:has(>td.empty){display:block;border:0;background:none;padding:0}
  #clogRows>tr>td.empty{margin:0}
  #clogRows>tr>td.empty{flex:1 1 100%;padding:28px 12px;text-align:center}

}
@media (max-width:900px){
  /* 삭제한 상담 창(900px 이하): 표 → 줄마다 카드(이름 · 일시 · 방식 · 교사 · 상태 / 삭제일 · D-n, [복구] 오른쪽) — 태블릿 창에서도 [복구]가 가로 스크롤 밖으로 나가지 않게 */
  .tbl-wrap:has(>.trtbl.cltr){overflow:visible;background:none}
  .trtbl.cltr{display:block;min-width:0;width:100%}
  .trtbl.cltr thead{display:none}
  .trtbl.cltr tbody{display:block}
  .trtbl.cltr tr{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;position:relative;padding:12px 100px 12px 0;border-bottom:1px solid var(--line2)}
  .trtbl.cltr td{display:block;padding:0;border:0;white-space:normal;font-size:14px}
  .trtbl.cltr td:nth-child(2){order:1;flex:1 1 100%;font-size:15px}
  .trtbl.cltr td:nth-child(1){order:2}
  .trtbl.cltr td:nth-child(3){order:3}
  .trtbl.cltr td:nth-child(4){order:4}
  .trtbl.cltr td:nth-child(5){order:5}
  .trtbl.cltr td:nth-child(6){order:6;font-size:13px;color:var(--muted)}
  .trtbl.cltr td:nth-child(6)::before{content:"삭제 "}
  .trtbl.cltr td:nth-child(7){order:7;font-size:13px}
  .trtbl.cltr td:is(:nth-child(3),:nth-child(4))::before{content:"· ";color:#98a3b3}
  .trtbl.cltr td:nth-child(4):empty{display:none}
  .trtbl.cltr td:nth-child(8){position:absolute;right:0;top:50%;transform:translateY(-50%)}
  .trtbl.cltr td:nth-child(8) .btn{min-height:44px;min-width:80px}
  .trtbl.cltr tr:has(>td.empty){display:block;padding:0}
  .trtbl.cltr td.empty{padding:28px 8px;text-align:center}

}
@media (min-width:601px) and (max-width:900px){
  .cltbl tbody{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
  #clogRows>tr{margin:0}
  #clogRows>tr:has(>td.empty){grid-column:1/-1}
}

/* ═══════════ 600px 이하(휴대폰) ═══════════ */
@media (max-width:600px){

  /* ── 상담 관리(휴대폰): 머리 단추 두 칸 · 상태 탭 한 줄(옆으로 밀기) · 카드는 한 줄에 하나(카드 배치는 위 900px 이하 규칙) ── */
  #clogView .card{padding:14px 12px}
  #clogView .sec-head .r{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #clogView .sec-head .r>*{min-height:44px;justify-content:center;white-space:nowrap}
  #clogView #startCounsel{grid-column:1/-1}
  #clTabs{overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  #clTabs::-webkit-scrollbar{display:none}
  #clTabs button{flex:none;white-space:nowrap;min-height:44px}
  /* ── 상담 진행 ── */
  /* 상담 정보: 상담 방식 · 상담 대상 · 상담 교사를 한 줄씩 */
  .ci-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .ci-grid>:nth-child(3){grid-column:auto}
  .ci-grid .seg2{display:flex;width:100%}
  .ci-grid .seg2 button{flex:1 1 0}
  /* 설문: 문항은 위 전체 폭, 응답 단추는 아래 전체 폭 한 줄 */
  .sv-it{padding:12px}
  .sv-a{align-items:stretch}
  .sv-ctl{width:100%}
  .sv-ctl>.tpk{flex:1 1 auto;min-width:0}
  .tpv{width:100%}
  .lvb2{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:100%}
  .lvb2 button{min-width:0}
  .qg{margin:0 12px}
  /* CARE-8 요약: 요소 이름 칸을 조금 줄인다 */
  .rs{grid-template-columns:28px 52px minmax(0,1fr) auto}
  /* 종료 단추: 두 칸 */
  #crunView .savebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #crunView .savebar .btn{min-height:48px;padding:0 10px;justify-content:center}
  /* 응답 팝업: 화면 아래 시트(녹음 바 위) — 어떤 문항인지 맨 위에 */
  .tpop.sheet{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:205;min-width:0!important;   /* 녹음 바(150) · 알림(200) 위, 확인 창(210) 아래 */max-height:72vh;max-height:72dvh;overflow-y:auto;
    overscroll-behavior:contain;border-radius:16px 16px 0 0;border-width:1px 0 0;
    padding:6px max(12px,env(safe-area-inset-right,0px)) calc(10px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));
    box-shadow:0 -12px 32px rgba(20,30,50,.22)}
  .tpop.sheet .tp-t{font-size:15px;font-weight:800;color:#16223a;padding:10px 4px 10px;border-bottom:1px solid var(--line2);margin-bottom:4px}
  .tpop.sheet .fqo{min-height:48px;font-size:15px}
  .tpop.sheet .tcols{height:180px}
  .tpop.sheet .tband{top:75px}
  .tpop.sheet .tcol{height:180px;width:64px}
  .tpop.sheet .tsp{height:75px}
  .tpop.sheet .ti{scroll-margin-top:75px}
  .tpop.sheet .tact{padding-top:10px}
  .tpop.sheet .tact .btn{flex:1 1 0;min-height:44px;font-size:15px;justify-content:center}

  /* ── AI 결과 리포트(휴대폰) ── */
  #rAva{display:none}
  #crepView .dhead h2{font-size:19px}
  .ract-main{gap:6px;padding-left:max(10px,env(safe-area-inset-left,0px));padding-right:max(10px,env(safe-area-inset-right,0px))}
  .ract-main .btn{padding:4px 6px;font-size:13.5px}
  .ract-main #repPrint svg{display:none}
  /* 상담 정보 10칸: 이름 · 값을 한 줄에 이어 써서(줄바꿈) 머리를 짧게 — 리포트가 첫 화면에 보이게 */
  #rInfo{margin-top:10px;padding-top:10px}
  .rinfo{display:flex;flex-wrap:wrap;gap:6px 14px}
  .rinfo div{flex-direction:row;align-items:baseline;gap:6px;min-width:0}
  .rinfo span{white-space:nowrap}
  .rinfo b{font-size:14px}

  /* ── 상담 일정(휴대폰): 점 달력 + 고른 날 일정 목록 ── */
  .sch-top{gap:10px}
  .sch-top .kpis{gap:8px}
  .skpi{padding:12px 10px}
  .skpi span{font-size:13px}
  .skpi b{font-size:22px;margin:2px 0}
  .skpi em{display:block;line-height:1.4}
  .sch-top>.r{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .sch-top>.r>.btn{min-height:44px;justify-content:center}
  #schedView .card.sec{padding:12px 8px 14px}
  .cal-head{gap:4px;flex-wrap:nowrap}
  .cal-head .sel{flex:1 1 0;min-width:0;padding-left:8px;padding-right:20px;background-position:right 5px center}
  #calY{flex-grow:1.2}
  #calToday{min-width:0;padding:0 10px;margin-left:0!important}
  .cal-wd div{padding:6px 0}
  .cd{position:relative;min-height:56px;padding:5px 1px 6px;align-items:center;gap:5px}
  .cd .cev{display:none}
  .cdn{margin:0;font-size:14px;line-height:22px;text-align:center}
  .cd.today .cdn{width:26px;height:26px;line-height:26px}
  .cal-dots{display:flex;align-items:center;justify-content:center;gap:3px;min-height:8px}
  .cal-dots i{width:7px;height:7px;border-radius:50%;background:#98a3b3}
  .cal-dots i.rv{background:#6941c6}.cal-dots i.rv.past{background:#d9822b}.cal-dots i.pg{background:var(--brand)}
  .cal-dots i.dn{background:#12795a}.cal-dots i.nr{background:#98a3b3}
  .cal-dots em{font-style:normal;font-size:12px;font-weight:800;line-height:1;color:#4c5870}
  .cd.out .cal-dots{opacity:.5}
  .cdsel{display:block;position:absolute;inset:0 -1px -1px 0;z-index:1;margin:0;padding:0;border:0;border-radius:0;background:transparent;   /* 칸 테두리까지 덮어 누르는 영역 44px 이상(360px 화면) */
    cursor:pointer;-webkit-tap-highlight-color:transparent}
  .cdsel:focus-visible{outline:2.5px solid var(--brand);outline-offset:-3px}
  .cd.sel{background:var(--brand-soft);box-shadow:inset 0 0 0 2px #a9c2e2}
  .cd.sel:not(.today) .cdn{color:var(--brand)}
  .cal-agenda{display:block;margin-top:14px}
  .cag-h{margin:0 2px 8px;font-size:15px;font-weight:800;color:#16223a}
  .cag-h span{margin-left:6px;font-size:13px;font-weight:700;color:var(--muted)}
  .cal-agenda .cev{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;margin:0 0 8px;padding:10px 12px;border-left-width:4px;border-radius:10px;
    font-size:14px;line-height:1.4;white-space:normal;text-align:left;-webkit-line-clamp:none;overflow:visible}
  .cag-t{flex:none;min-width:46px;font-weight:800;font-variant-numeric:tabular-nums}
  .cag-m{flex:1 1 auto;min-width:0}
  .cag-m b{font-size:15px}
  .cal-agenda .cev .cst{flex:none}
  .cag-empty{padding:18px 12px;border:1px dashed var(--line);border-radius:10px;text-align:center;font-size:14px;color:var(--muted)}
  .cal-lg{margin-top:4px}
  /* 일정 창: 항목 이름 칸을 줄인다 */
  .evinfo div{grid-template-columns:96px minmax(0,1fr);gap:8px;font-size:14px}
  .evinfo span{font-size:13px}

  /* ── CARE-8(학습 변인) ── */
  .cbk-body{padding:14px 12px}
  .cbk-crit{grid-template-columns:minmax(0,1fr);gap:6px}
  .cbk-crit div{flex-direction:row;align-items:baseline;gap:8px}
  .cbk-crit .cg{flex:none}
  .cbk-h{flex-wrap:wrap}

}

/* ═══════════ 터치 태블릿 가로(900px 초과 · 손가락 입력 — 아이패드 가로 1024 등) ═══════════
   배치는 데스크톱 그대로(마우스 데스크톱은 받지 않는다 — M1). 누르는 곳 44px · 대비 4.5:1 · 보조 글 13px 만 900px 이하와 같게,
   A4 리포트는 리포트 칸에 맞춰 줄여 보인다(app-report.js repFit). 단추 · 입력 칸 공용 44px 는 m-shell.css */
@media (min-width:901px) and (pointer:coarse){
  /* 녹음 바: [일시정지] · [이어서 녹음] · [중지] 44px · 녹음 개수 · 용량 13px */
  .rb-btn,.rb-stop{min-height:44px;padding:0 18px;font-size:14px}
  .rb-in .lb{font-size:13px;color:#c4cede}
  /* 상담 진행 · CARE-8 설문: 응답 단추 · 응답 선택 · 상담 질문 접기 줄 · 공통 질문 · 응답 팝업 */
  #crunView .chart-head .seg button{min-height:44px;min-width:44px}
  .lvb2 button{min-height:44px}
  .tpv{height:44px}
  .qg-h{min-height:44px}
  .acc-h{min-height:48px}
  .fqo{min-height:44px}
  .tact .btn{min-height:44px;padding:0 16px;font-size:14px}
  /* 대비 4.5:1 이상 — 응답 전 '선택' · 팝업 '미입력' · 고른 '보통' · 여러 개 선택 안내 */
  .tpv.empty{color:#5f6b7d}
  .fqo.mu{color:#5f6b7d}
  .fqhint{font-size:13px;color:#5f6b7d}
  .lvb2 button.g2.on{background:#9a6a0e;border-color:#9a6a0e}
  /* 작은 글 13px(데스크톱 11.5~12.5px) */
  .rlg,.pv,.qk,.cs-lb,.rinfo span,.aunote2,.skpi em,.cal-lg,.cal-wd div{font-size:13px}
  .sv-h .r,#svMount .qg .qg-t,.tpop .tu,.cdn,.evinfo span,.cbk-gl,#clTabs button span{font-size:13px}
  /* 상담 관리: 학생 이름 · [예약 변경] — 줄 높이는 그대로 두고 누르는 영역 44px.
     체크 칸은 칸 전체(44px)를 누름 영역으로(app-counsel.js clCkMQ), '전체 선택'은 44px label(글은 화면 읽기에만) */
  #clogRows .nm.lnk2{padding:14px 8px;margin:0 -8px}
  #clogRows .xsbtn{min-height:44px;padding:0 12px;font-size:13px}
  .cltbl thead th.ck,#clogRows>tr>td.ck{width:44px;min-width:44px;cursor:pointer}
  #clogView .ckall{display:inline-grid;place-items:center;min-width:44px;min-height:44px;margin:-10px 0;cursor:pointer;vertical-align:middle}
  #clogView .ckall-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
  /* 상담 일정: 달 이동 44px · 일정 단추는 두 줄까지 · 44px */
  #calPrev,#calNext{width:44px;height:44px}
  .cev{min-height:44px;font-size:13px;white-space:normal;line-height:1.3;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  /* CARE-8(학습 변인) 요소 목록 · 녹음 파일 창 · 녹음 안내 글 속 '개인정보처리방침'(줄 높이는 그대로 · 누르는 영역만 위아래로) */
  #cbkNav button{min-height:44px}
  .aurow .lnkbtn{min-height:44px;display:inline-flex;align-items:center}
  .aurow .del{width:44px;height:44px;flex:none}
  .policy .cplink{display:inline-block;padding:12px 0;margin:-12px 0}
  /* AI 결과 리포트: A4 쪽(794px)을 리포트 칸(약 730px) 너비에 맞게 줄인다(핀치 확대 · 문장 고치기 그대로) — [크게 보기]는 머리 단추 줄에 */
  #repMount.fit .rp-page{zoom:var(--rp-z,1)}
  #repMount .rp-ed{scroll-margin:0 16px}
  #repFit:not([hidden]){display:inline-flex;align-items:center;justify-content:center;gap:6px}
  #repFit svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
}
/* 상담 진행(900px 초과 ~ 1180px · 손가락 입력): 한 열이 되면 큰 CARE-8 레이더가 첫 화면을 다 차지해 학생 머리가 화면 아래(1067px)에 있었다 →
   900px 이하와 같은 순서(학생 머리 → 상담 정보 → 이전 계획 → 성적 추세 → 레이더 → 설문 → 공통 질문 → 종료 단추). DOM · id 는 그대로 */
@media (min-width:901px) and (max-width:1180px) and (pointer:coarse){
  .crun-grid{display:flex;flex-direction:column;align-items:stretch;gap:16px}
  .crun-main{display:contents}
  .crun-grid .card.sec{margin-top:0}
  .crun-left{order:1;position:static}
  .crun-main>:nth-child(n+5){order:2}
  .crun-main>.savebar{margin-top:4px}
  .radar-card svg{max-width:360px;margin:0 auto}
}
