/* 오픈카톡 콘솔 — 폰 · 좁은 화면 (console.css 다음에 부름)
   규칙: 이 파일은 @media 안에서만 바꾼다. 넓은 화면은 console.css 그대로.
   화면마다 <style> 이 console.css 뒤에 오므로, 그 칸을 바꿀 땐 html body 로 앞선다. */

/* 중간 폭 — 왼쪽 760 + 오른쪽 336 두 칸이 안 들어가면 한 칸으로 */
@media (max-width: 1140px) {
  html body .grid { grid-template-columns: minmax(0, 1fr); }
  html body .wrap { padding-left: 16px; padding-right: 16px; }
}

/* 폰 — 760px 아래 */
@media (max-width: 760px) {
  html, body { font-size: 16px; -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  /* 머리 — 로고 · 알약(줄바꿈) 한 덩이, 메뉴는 아래 줄에서 가로 넘김 */
  html body .top { position: relative; }
  html body .top .in { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; }
  html body .top .sp { display: none; }
  html body .logo { font-size: 17px; margin-right: auto; min-height: 40px; }
  html body .top .pill { height: 36px; font-size: 14px; padding: 0 14px; }
  html body .nav {
    order: 10; flex: 0 0 auto; flex-wrap: nowrap; gap: 4px;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 0 -16px; padding: 4px 16px 8px; width: calc(100% + 32px); flex-basis: calc(100% + 32px);
  }
  html body .nav::-webkit-scrollbar { display: none; }
  html body .nav a { flex: none; min-height: 44px; display: inline-flex; align-items: center; font-size: 16px; padding: 0 16px; }

  /* 본문 틀 */
  html body .wrap { padding: 16px 16px 72px; }
  html body .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  html body .panel { padding: 20px 16px; }
  html body .q { font-size: 19px; margin-bottom: 16px; }
  html body .sub { margin-left: 0; margin-top: -8px; font-size: 15px; }
  html body .kv { font-size: 16px; gap: 12px; }

  /* 걸음 띠 — 가로 넘김 */
  html body .steps {
    overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    gap: 8px; margin: 0 -16px 16px; padding: 0 16px;
  }
  html body .steps::-webkit-scrollbar { display: none; }
  html body .steps .s { flex: none; height: 48px; padding: 0 16px; font-size: 16px; white-space: nowrap; }

  /* 카드 — 한 줄 하나씩 */
  html body .cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html body .card { min-height: 0; padding: 18px 16px; }
  html body .card p { font-size: 16px; }
  html body .card h3 { font-size: 18px; }

  /* 단추 · 입력 — 엄지로 누르기 쉽게 48 이상, 글자 16(폰이 저절로 확대하지 않게) */
  html body .btn { min-height: 48px; height: auto; font-size: 16px; padding: 10px 20px; justify-content: center; }
  html body .in-text, html body select { height: 48px; font-size: 16px; }
  html body textarea { font-size: 16px; }
  html body label.l { font-size: 15px; }
  /* 화면 안 <style> 의 (0,2,0) 규칙보다 앞서게 — 16px 아래 칸은 iOS 가 저절로 확대함 */
  html body .card .in-text, html body .in3 .in-text, html body .ed .in-text, html body .ed select,
  html body .mform .in-text, html body .mform select { height: 48px; font-size: 16px; }
  html body .card label.l { font-size: 15px; }
  html body .night .in-text { width: 100%; }
  html body .tag { font-size: 13px; padding: 4px 10px; }

  /* 표 — 가로 넘김 칸 안에 */
  html body table.t { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 15px; }
  html body table.t td, html body table.t th { padding: 12px 10px; }
  html body .q-list td.txt { max-width: 200px; }

  /* 승인 — 큰 판 · 큰 단추(으뜸 단추가 맨 위) */
  html body .hero { padding: 20px 16px; margin-bottom: 16px; border-radius: 14px; }
  html body .hero .who { gap: 8px; }
  html body .hero .who h3 { font-size: 20px; flex: 1 1 100%; order: -1; }
  html body .hero .pos { font-size: 15px; }
  html body .hero .why { font-size: 15px; }
  html body .hero textarea { font-size: 17px; min-height: 160px; line-height: 1.65; }
  /* 작은 폰(375x667)에서도 으뜸 단추가 늘 보이게 — 판 아래에 붙임 */
  html body .hero .acts { flex-direction: column-reverse; gap: 10px; position: sticky; bottom: 0; z-index: 2;
    background: var(--white); margin-left: -16px; margin-right: -16px; margin-bottom: -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
  html body .hero .acts .btn { width: 100%; min-height: 54px; font-size: 17px; }
  html body .hero .empty > div { flex-direction: column; }
  html body .hero .empty .btn { width: 100%; }
  html body .note { font-size: 15px; }

  /* 화면마다 따로 쓴 칸 */
  html body .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body .due li { flex-wrap: wrap; gap: 4px 12px; }
  html body .due .nm { min-width: 0; }
  html body .due .dr { flex: 1 1 100%; order: 3; font-size: 15px; }
  html body .rules, html body .mform, html body .ed .two { grid-template-columns: minmax(0, 1fr); }
  html body .mform .f.full, html body .in2.wide { grid-column: auto; }   /* span 2 가 숨은 둘째 칸을 만들지 않게 */
  html body .rules .f { grid-template-columns: minmax(0, 1fr) 96px; font-size: 15px; }
  html body .gate .panel { padding: 32px 20px; }
  html body .drop { min-height: 160px; padding: 20px 16px; }

  /* 알림 띠 — 화면 밖으로 안 나가게 */
  html body .toast { max-width: calc(100% - 32px); width: max-content; text-align: center; font-size: 15px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
