/* =========================================================
   모바일 전용 (600px 이하) — PC 화면은 건드리지 않음
   ========================================================= */
@media (max-width: 600px) {
  /* 상단: 안내 띠 숨기고 헤더 낮게 */
  .topbar { display: none; }
  .header-in { height: 58px; }
  .logo-text { font-size: 22px; }
  .logo-text small { font-size: 9px; }

  /* 첫 화면: 약콩이는 작게, 글자 먼저 보이게 */
  .hero-in { padding-top: 18px; padding-bottom: 22px; gap: 4px; }
  .hero-art { min-height: 0; }
  .hero-arts { height: 128px; }
  .hero-art-item .art-svg { height: 128px; }
  .hero-art .d1 { width: 120px; height: 120px; }
  .hero-art .d2, .hero-art .d3 { display: none; }
  .hero-say { font-size: 12px !important; padding: 6px 10px !important; top: 0 !important; left: 4px !important; }
  .hero-say::after { right: 18px; bottom: -11px; width: 14px; height: 14px; }
  .eyebrow { margin-bottom: 10px; font-size: 12px; }
  .slide h1 { font-size: 27px; }
  .hero-sub { font-size: 14px; margin-top: 8px; }
  .slider-ctrl { margin: 16px 0 14px; }
  .hot { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; margin-top: 14px; }
  .hot::-webkit-scrollbar { display: none; }
  .hot a, .hot span { flex: none; }
  .ticker-row { margin-top: 0; padding-bottom: 16px; }
  .ticker-label { padding: 8px 10px; }
  .tk-item { padding: 0 16px; font-size: 13px; }

  /* 바로가기 카드: 더 촘촘하게 */
  .section { padding: 36px 0; }
  .sec-head { margin-bottom: 20px; }
  .sec-head h2 { font-size: 23px; }
  .quick { gap: 8px; }
  .q-card > a { padding: 14px 12px; border-radius: 18px; }
  .q-ic { width: 40px; height: 40px; margin-bottom: 8px; }
  .q-ic .ic { width: 22px; height: 22px; }
  .q-name { font-size: 15px; }
  .q-desc { display: none; }
  .badge { margin-top: 6px; }
  .features { gap: 12px; }
  .feature { padding: 22px 20px; }
  .f-ic { width: 96px; height: 96px; }

  /* 메뉴 머리말: 큰 약콩이 대신 제목 오른쪽에 작은 약콩이 */
  .page-head { padding-top: 14px; }
  .ph-grid { grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
  .ph-art { order: 0; min-height: 0; padding-top: 0; align-self: end; }
  .ph-art .art-svg { height: 92px; animation: none; }
  .ph-art .d1, .ph-art .d2 { display: none; }
  .crumb { font-size: 12px; }
  .ph-row { margin: 8px 0 12px; gap: 10px; }
  .ph-ic { display: none; }
  .ph-row h1 { font-size: 25px; }
  .ph-row p { font-size: 13px; }
  .tabs a { padding: 10px 14px; font-size: 14px; }

  /* 검색·필터: 필터 버튼은 한 줄로 옆으로 밀기 */
  .view-sec { padding-top: 18px; }
  .intro-card { display: none; }
  .vsearch { margin-bottom: 12px; }
  .chips, .src-jump, .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; padding-bottom: 4px; }
  .chips::-webkit-scrollbar, .src-jump::-webkit-scrollbar, .subtabs::-webkit-scrollbar { display: none; }
  .fchip, .src-jump a { flex: none; }
  .subtabs { margin-bottom: 14px; }
  .subtabs button { padding: 8px 14px; font-size: 14px; }

  /* 목록 카드 */
  .cards.one { gap: 8px; }
  .cards.one .card-row { padding: 12px 14px; border-radius: 16px; }
  .cards.one .card-row:has(.tag.st) { padding-right: 14px; }
  .cards.one .card-row .tag.st { top: 10px; right: 10px; }
  .cards.one .cr-top h4 { font-size: 15px; padding-right: 54px; }
  .cards.one .kv { font-size: 13px; gap: 2px 12px; }
  .cards.one .card-row > p.clamp { font-size: 13px; }
  .cards.one.roomy .card-row { padding: 14px 16px; }
  .cards.one.roomy .kv { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .cards.one.roomy .kv > div:nth-child(2) { grid-column: 1 / -1; }
  .pager button { min-width: 34px; height: 34px; font-size: 13px; }

  /* 약제급여 표 → 모바일은 카드 줄 (제품명 · 업체 · 상한금액) */
  .dg-wrap:has(.dg-reimb) { background: none; box-shadow: none; overflow: visible; }
  .dg-wrap { overflow-x: auto; }
  .dg-reimb { min-width: 0; font-size: 13px; }
  .dg-reimb thead { display: none; }
  .dg-reimb, .dg-reimb tbody { display: block; }
  .dg-reimb tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; background: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 6px; box-shadow: 0 2px 0 rgba(43, 58, 85, .05); }
  .dg-reimb td { display: none; border: 0; padding: 0; white-space: normal; background: none !important; }
  .dg-reimb tr:not(.dg-group) td:nth-child(5) { display: block; grid-column: 1 / -1; font-weight: 700; min-width: 0; }
  .dg-reimb tr:not(.dg-group) td:nth-child(6) { display: block; color: var(--ink-2); }
  .dg-reimb tr:not(.dg-group) td:nth-child(9) { display: block; text-align: right; font-size: 15px; color: var(--blue-deep); }
  .dg-reimb tr:not(.dg-group) td:nth-child(9)::before { content: '₩'; font-size: 12px; margin-right: 1px; }
  .dg-reimb tr.dg-group { background: var(--mint-bg); margin-top: 12px; }
  .dg-reimb tr.dg-group td:nth-child(4) { display: block; grid-column: 1 / -1; }
  .dg-reimb tr.dg-group td:nth-child(3) { display: block; grid-column: 1 / -1; font-size: 11px; color: var(--mint-deep); order: -1; }
  .dg-bar .meta-line { margin-bottom: 8px; }
  .xl-btn { padding: 7px 12px; font-size: 13px; margin-bottom: 8px; }

  /* 손 든 약콩이: 작게, 말 없이 / 펼친 브리핑은 아래에서 올라오는 판 */
  .brief-fab { width: 64px; right: 10px; bottom: 12px; }
  .brief-fab .art-svg { width: 64px; }
  .brief-fab .fab-say { display: none; }
  .brief-fab .fab-x { width: 22px; height: 22px; font-size: 10px; right: -6px; top: -4px; }
  .brief-pop { left: 0; right: 0; bottom: 0; max-width: none; }
  .bp-presenter { display: none; }
  .bp-bubble { margin: 0; width: 100%; border-radius: 22px 22px 0 0; max-height: 78vh; border-width: 3px 0 0; box-shadow: 0 -10px 30px rgba(43, 58, 85, .2); transform-origin: 50% 100%; }
  .bp-bubble::after { display: none; }

  /* 증시 브리핑 */
  .mk-cards { grid-template-columns: 1fr 1fr; }
  .mk-card b { font-size: 17px; }
  .panel { padding: 16px; border-radius: 20px; }
  .mk-vnum { font-size: 12px; gap: 6px; }

  /* 소싱 */
  .src-sec > summary { padding: 12px 14px; }
  .src-title small { display: none; }
  .src-item p { grid-template-columns: 62px 1fr; }

  /* 뉴스 */
  .news-col { padding: 16px; }
  .news-list a { padding: 9px 0; font-size: 14px; }

  /* 맨 아래 여백(약콩이 버튼에 가리지 않게) */
  main { padding-bottom: 60px; }
}
@media (max-width: 860px) { .qboard { grid-template-columns: 1fr; } .qg-art { display: none; } }
@media (max-width: 600px) {
  .qg { padding: 16px 12px 12px; border-radius: 22px; }
  .qg h3 span { font-size: 20px; }
  .qg li > a { padding: 9px 62px 9px 10px; }
  .qg-ic { width: 36px; height: 36px; }
  .qg-t small { display: none; }
}
@media (max-width: 600px) {
  .pv2-tabs { overflow-x: auto; scrollbar-width: none; gap: 4px; margin-right: -16px; padding-right: 16px; }
  .pv2-tabs::-webkit-scrollbar { display: none; }
  .pv2-tabs button { flex: none; padding: 10px 14px; font-size: 17px; }
  .pv2-tabs button small { display: none; }
  .pv2-pane { padding: 14px; gap: 10px; border-radius: 0 22px 22px 22px; }
  .pv2-art { display: none; }
  .pv2-list { grid-template-columns: 1fr; gap: 8px; }
  .pv2-list a { padding: 10px 46px 10px 12px; }
  .pv2-ic { width: 38px; height: 38px; }
  .pv2-list small { display: none; }
}
/* 모바일 첫 화면 말풍선: 약콩이 바로 왼쪽, 꼬리는 약콩이 쪽(오른쪽) */
@media (max-width: 600px) {
  .hero-art .hero-say.bubble { left: auto !important; right: calc(50% + 46px); top: 30px !important; }
  .hero-art .hero-say.bubble::after { right: -10px; left: auto; top: 50%; bottom: auto; width: 14px; height: 14px; border-bottom: 0; border-left: 0; border-top: 3px solid var(--ink); border-right: 3px solid var(--ink); transform: translateY(-50%) rotate(45deg); }
}

/* ===== 모바일 첫 화면 다듬기 (2026-11-14) ===== */
@media (max-width: 600px) {
  /* 약콩이: 가운데 위 → 제목 오른쪽 끝에 작게, 말풍선·장식 없이 */
  .hero-in { display: block; position: relative; }
  .hero-art { position: absolute; top: 14px; right: 12px; width: 96px; min-height: 0; z-index: 1; pointer-events: none; }
  .hero-arts { height: 104px; }
  .hero-art-item .art-svg { height: 104px; }
  .hero-art .hero-say, .hero-art .deco { display: none !important; }
  .eyebrow, .slide h1 { padding-right: 100px; }

  /* 무엇을 찾아볼까요: 탭은 3칸 고르게, 메뉴는 2열 타일 */
  .sec-head p { display: none; }
  .pv2-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-right: 0; padding-right: 0; overflow: visible; }
  .pv2-tabs button { padding: 10px 0; font-size: 16px; text-align: center; border-radius: 16px 16px 0 0; }
  .pv2-pane { padding: 12px; border-radius: 0 0 22px 22px; }
  .pv2-list { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pv2-item > a, .pv2-list a { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 12px 14px; min-height: 96px; }
  .pv2-ic { width: 34px; height: 34px; }
  .pv2-list b { font-size: 15px; line-height: 1.3; word-break: keep-all; }
  .pv2-item .fav { top: 8px; right: 6px; transform: none; width: 28px; height: 28px; }
  .pv2-item .fav:hover { transform: scale(1.1); }
  .pv2-item .fav .ic { width: 18px; height: 18px; }
  .fav-strip { padding: 12px 14px; gap: 10px; }

  /* 약콩이가 추천해요: 세로로 쌓지 말고 옆으로 넘기는 카드 */
  .features { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: -16px; padding: 0 16px 6px 0; }
  .features::-webkit-scrollbar { display: none; }
  .feature { flex: 0 0 78%; scroll-snap-align: start; padding: 18px; min-height: 0; }
  .feature h3 { font-size: 22px; margin-top: 10px; }
  .feature .f-body { display: none; }
  .f-ic { width: 76px; height: 76px; right: -12px; bottom: -12px; }
  .f-ic .ic { width: 30px; height: 30px; margin: -8px 0 0 -8px; }
}

/* ===== 모바일 첫 화면 2차 (2026-11-14) ===== */
@media (max-width: 600px) {
  /* 약콩이: 세 장 모두 같은 자리 — 제목 글자 바로 오른쪽에 서 있게 */
  .hero-art { top: 38px; right: 6px; width: 92px; }
  .hero-arts { height: 108px; justify-content: center; }
  .hero-art-item, .hero-art-item.art-study, .hero-art-item.art-captain { margin-left: 0; left: 50%; bottom: 0; }
  .hero-art-item .art-svg { height: 108px; animation: none; }
  .eyebrow, .slide h1 { padding-right: 96px; }

  /* 무엇을 찾아볼까요: 가로 3칸 꽉 채우고 아래로 */
  .pv2-list { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pv2-item > a, .pv2-list a { align-items: center; text-align: center; gap: 6px; padding: 12px 4px 10px; min-height: 88px; border-radius: 14px; }
  .pv2-ic { width: 32px; height: 32px; }
  .pv2-list b { font-size: 13px; }
  .pv2-item .fav { top: 2px; right: 2px; width: 24px; height: 24px; }
  .pv2-item .fav .ic { width: 15px; height: 15px; }
}
@media (max-width: 600px) {
  /* 메뉴 판: PC의 '그림 | 목록' 두 칸을 풀어 목록이 가로를 다 쓰게 */
  .pv2-pane { display: block; grid-template-columns: none; }
  /* 약콩이 자리는 화면 크기를 재서 JS가 정함 (제목 글자가 끝나는 바로 오른쪽) */
  .hero-art.placed { right: auto; }
}
