/* 하토담 — 폰에서도 PC 판(2026-11-24 사용자 "모바일 버전 말고 걍 PC 버전을 모바일 최적화처럼").
   config.php 훅이 767/768px 경계(모바일 판 ↔ PC 판 스위치) 미디어 질의 · JS 폭 검사를 '늘 PC'로 바꿔 내보내므로
   폰도 PC 화면(같은 마크업 · 같은 메뉴)을 받는다. 이 파일은 그 PC 화면을 좁은 화면에 맞추는 규칙만 — 767px 이하에서만 켜진다. */
.pcm-only { display: none; }
@media (max-width: 767px) {
  html, body { overflow-x: clip !important; }
  body { min-width: 0 !important; -webkit-text-size-adjust: 100%; }
  img, video, iframe, embed, canvas { max-width: 100%; }
  img { height: auto; }
  pre, code { white-space: pre-wrap; word-break: break-word; }

  /* ── 작은 버튼 · 탭 · 칩은 글자가 세로로 쪼개지지 않게 ── */
  .btn, .btn-sm, .btn-primary, .btn-ghost, .btn-secondary, .tab, .explore-tab, .topbar-btn, .dc-header-btn, .dc-nav-item,
  [class*="-tab"], [class*="chip"], [class*="pill"], [class*="badge"], .board-scope a, .boards-scope a, .bh-actions a, .bh-actions button {
    white-space: nowrap; word-break: keep-all;
  }
  .tabs, .explore-tabs, .boards-scope, .bh-command-strip, .dc-tabs, .sort-tabs, .filter-tabs {
    flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%;
  }
  .tabs::-webkit-scrollbar, .explore-tabs::-webkit-scrollbar, .boards-scope::-webkit-scrollbar, .bh-command-strip::-webkit-scrollbar { display: none; }
  .tabs > *, .explore-tabs > *, .boards-scope > *, .bh-command-strip > * { flex: 0 0 auto !important; }

  /* ── 홈 · 전체 글 셸(.wrapper = 왼쪽 메뉴 + 본문) → 왼쪽 메뉴는 서랍 ── */
  .wrapper { display: block !important; min-width: 0 !important; }
  .wrapper > aside.sidebar {
    position: fixed !important; top: 0 !important; left: 0 !important; bottom: 0 !important; height: 100dvh !important;
    width: min(300px, 84vw) !important; max-width: none !important; z-index: 1300 !important;
    transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); overflow-y: auto !important;
    overscroll-behavior: contain; display: flex !important; flex-direction: column;
  }
  html.pcm-nav-open .wrapper > aside.sidebar { transform: none; box-shadow: 0 0 48px rgba(0, 0, 0, .28); }
  .pcm-backdrop { position: fixed; inset: 0; z-index: 1250; background: rgba(10, 10, 14, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
  html.pcm-nav-open .pcm-backdrop { opacity: 1; pointer-events: auto; }
  html.pcm-nav-open, html.pcm-nav-open body { overflow: hidden !important; }
  .wrapper > main.main, .wrapper > .main {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 0 !important; padding: 0 12px 28px !important;
  }
  .main > .topbar {
    display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px !important;
    height: auto !important; min-height: 56px; padding: 8px 0 !important; margin: 0 0 10px !important;
  }
  .pcm-menu-btn { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 0; flex-direction: column;
    border: 1px solid rgba(0, 0, 0, .12); border-radius: 12px; background: #fff; cursor: pointer; padding: 0; }
  .pcm-menu-btn i { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; margin: 2px 0; }
  .pcm-logo { flex: none; display: inline-flex; align-items: center; }
  .pcm-logo img { height: 26px; width: auto; }
  .main > .topbar .search-wrap { flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; max-width: none !important; }
  .main > .topbar .search-wrap form, .main > .topbar .search-wrap input { width: 100% !important; min-width: 0 !important; }
  .main > .topbar input.search { height: 40px !important; font-size: 15px !important; }
  .main > .topbar .topbar-right { flex: none !important; display: flex !important; gap: 6px !important; flex-wrap: nowrap !important; }
  .main > .topbar .topbar-btn { padding: 9px 11px !important; font-size: 13px !important; height: auto !important; line-height: 1.2 !important; border-radius: 10px !important; }
  .main > .content { display: block !important; width: 100% !important; min-width: 0 !important; }
  .main > .content > * { min-width: 0 !important; width: auto !important; max-width: 100% !important; }
  .main > .content > * + * { margin-top: 16px; }

  /* 홈 구역들 — 여러 칸 격자는 한 칸(작은 칸은 두 칸) */
  .home-hub, .hs-participation-grid, .hs-daily-seed, .topic-grid, .topic-grid.compact, .hot-debates > div[style*="grid"],
  .hub-grid, .two-col, .grid-2, .cols-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .home-overview { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .img-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .hero, .hero-image { min-height: 0 !important; }
  .side-stack { width: auto !important; }
  .hs-direct-ad-link { grid-template-columns: 56px minmax(0, 1fr) auto !important; }

  /* DC 식 목록 표 — 칸을 줄이고 제목이 넉넉하게 */
  table.dc-list { width: 100% !important; table-layout: auto !important; }
  table.dc-list th, table.dc-list td { padding: 9px 4px !important; font-size: 13.5px !important; }
  table.dc-list .dc-title, table.dc-list .dc-title a { white-space: normal !important; word-break: break-word; }
  table.dc-list td:has(> a.dc-board) { max-width: 72px; }
  table.dc-list a.dc-board { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

  /* ── 옛 머리(.dc-header · .dc-nav-bar — 보드 · 채팅 · 쪽지 · 상점 등) ── */
  .dc-header { gap: 6px !important; padding: 0 8px !important; min-width: 0 !important; }
  .dc-header-logo { flex: none !important; width: auto !important; }
  .dc-header-logo span { display: none !important; }
  .dc-header-logo img { height: 26px !important; width: auto !important; }
  .dc-header-search { flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; max-width: none !important; }
  .dc-header-search input { width: 100% !important; min-width: 0 !important; }
  .dc-header-right { flex: none !important; gap: 4px !important; width: auto !important; }
  .dc-header-right #themeToggleBtn, .dc-header-right #noEffectsToggleBtn { display: none !important; }
  .dc-header-btn { padding: 8px 10px !important; font-size: 13px !important; white-space: nowrap; }
  .dc-nav-bar { justify-content: flex-start !important; overflow-x: auto !important; scrollbar-width: none; flex-wrap: nowrap !important; }
  .dc-nav-bar::-webkit-scrollbar { display: none; }
  .dc-nav-item { flex: 0 0 auto !important; padding: 0 12px !important; }

  /* ── 로그인 · 가입(.auth-split: 왼쪽 주황 판 + 오른쪽 폼) → 위아래 ── */
  .auth-split { flex-direction: column !important; width: 100% !important; min-height: 0 !important; }
  .auth-brand { width: 100% !important; min-height: 0 !important; flex: none !important; padding: 18px 16px !important; }
  .auth-brand-inner { display: flex !important; align-items: center; gap: 12px; width: 100% !important; max-width: none !important; }
  .auth-brand-logo { width: auto !important; height: 44px !important; margin: 0 !important; }
  .auth-brand-mascot, .auth-brand-desc { display: none !important; }
  .auth-brand-slogan { margin: 0 !important; font-size: 15px !important; text-align: left !important; }
  .auth-form-panel { width: 100% !important; flex: 1 1 auto !important; padding: 18px 14px 28px !important; }
  .auth-card { width: 100% !important; max-width: 440px !important; margin: 0 auto !important; }
  .recaptcha-wrap { transform: scale(.9); transform-origin: left top; max-width: 100%; }

  /* 홈 첫 장면(마스코트 + 글) — 마스코트는 오른쪽 아래로 작게, 글이 위 */
  .hero .hero-image { padding: 22px 18px !important; min-height: 0 !important; }
  .hero .hero-logo-bg { width: 150px !important; height: 150px !important; right: -18px !important; left: auto !important; top: auto !important; bottom: -10px !important; opacity: .28 !important; }
  .hero .hero-content { width: 100% !important; padding: 0 !important; }
  .hero h1 { font-size: 30px !important; line-height: 1.2 !important; }
  .hero p { width: auto !important; max-width: 100% !important; }
  .hero .hero-buttons { flex-wrap: wrap !important; gap: 8px !important; }
  /* 전체 글 카드 — 한 줄에 하나 */
  .post-grid, #postGrid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .post-card-footer { flex-wrap: wrap; gap: 6px; }
  .post-card-author, .post-card-stats { white-space: nowrap; }
  /* 글 화면 — 떠 있는 '읽기 모드' 단추는 본문을 가려서 숨김, 댓글 머리는 줄바꿈 */
  #hsZenToggle, .hs-zen-toggle { display: none !important; }
  [class*="comment"] [class*="meta"], [class*="cmt"] [class*="meta"], [class*="comment-head"], [class*="cmt-head"] { flex-wrap: wrap; row-gap: 4px; }
  [class*="comment"] [class*="meta"] *, [class*="cmt"] [class*="meta"] * { white-space: nowrap; }
  .pcm-logo img { height: 30px; }

  /* 로그인했을 때 머리 — 이름 글자는 빼고(동그라미만), 검색칸은 누르면 머리 전체로 펼침 */
  .main > .topbar .user-name, .dc-header-username, .dc-header-caret { display: none !important; }
  .main > .topbar .notif-btn, .main > .topbar .user-avatar { flex: none !important; }
  .dc-header { position: fixed; }
  .dc-header-search { min-width: 40px !important; }
  .dc-header-search:focus-within { position: absolute !important; left: 8px !important; right: 8px !important; top: 9px !important; z-index: 5 !important; width: auto !important; background: #fff; }
  .dc-header-right .hdr-icon-wrap, .dc-header-right .dc-header-icon-btn { flex: none !important; }
  .dc-user-dropdown { right: 0 !important; left: auto !important; max-width: calc(100vw - 16px) !important; }

  /* 설정 — 왼쪽 탭 줄은 위쪽 가로 띠(밀어서 넘김), 본문은 한 칸 */
  html body.settings-page-body:not(#pcm) .settings-layout, html body.settings-page-body:not(#pcm) .settings-layout.desktop-only { display: block !important; grid-template-columns: none !important; width: 100% !important; padding: 0 12px !important; }
  html body.settings-page-body:not(#pcm) .settings-layout > .settings-tabs { position: static !important; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    gap: 10px !important; width: auto !important; max-width: none !important; overflow-x: auto !important; scrollbar-width: none; padding: 8px 2px !important; margin: 0 0 12px !important; height: auto !important; }
  .settings-layout > .settings-tabs::-webkit-scrollbar { display: none; }
  html body.settings-page-body:not(#pcm) .settings-tabs .stab-group { flex: 0 0 auto !important; flex-direction: row !important; align-items: center; gap: 6px !important; width: auto !important; }
  html body.settings-page-body:not(#pcm) .settings-tabs .stab-group-label { display: none !important; }
  html body.settings-page-body:not(#pcm) .settings-tabs .stab-row { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; width: auto !important; }
  html body.settings-page-body:not(#pcm) .settings-tabs .stab-row > * { flex: 0 0 auto !important; white-space: nowrap !important; width: auto !important; }
  html body.settings-page-body:not(#pcm) .settings-layout > .settings-content { width: 100% !important; max-width: 100% !important; min-width: 0 !important; padding: 0 !important; }
  html body.settings-page-body:not(#pcm) .settings-content .settings-section { padding: 16px 14px !important; }
  html body.settings-page-body:not(#pcm) .settings-content .form-group, html body.settings-page-body:not(#pcm) .settings-content form, html body.settings-page-body:not(#pcm) .settings-content details { width: auto !important; max-width: 100% !important; }
  html body.settings-page-body:not(#pcm) .settings-content p, html body.settings-page-body:not(#pcm) .settings-content .setting-desc { white-space: normal !important; overflow-wrap: anywhere; max-width: 100% !important; }
  html body.settings-page-body:not(#pcm) .settings-content .settings-section > * { max-width: 100% !important; min-width: 0 !important; }
  /* 옛 머리 오른쪽(알림 · 쪽지 글자) — 글자는 숨기고 아이콘만 */
  .dc-header-right a:not(.dc-header-btn) { white-space: nowrap; }

  /* ── 공통 카드 · 격자 · 입력 ── */
  .boards-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  input, select, textarea { max-width: 100%; }
  .modal, .modal-content, [class*="modal"] > div { max-width: calc(100vw - 24px); }
}
