/* ==========================================================================
   owner: content
   CPIMO main.css — 커뮤니티 메인(S01) 전용 규칙. 확정 디자인 community-final/style.css 에서 옮겨 두기만 했다.
   foundation 은 이 파일을 더 고치지 않는다(content 모듈이 이어받아 고친다).
   공통 토큰·헤더·패널·배지·버튼은 base.css / components.css 에 있다.
   ========================================================================== */

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 24px; align-items: start; padding-block: 24px 28px; }
.col-main, .col-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* ---------- 에이전시 조회 ---------- */
.lookup { z-index: 5; border-top: 0; }
.lookup__hd { display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 0 20px; background: var(--navy); color: #b8c0cd; }
.lookup__hd h2 { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.lookup__hd h2 .i { width: 21px; height: 21px; color: var(--lime); }
.lookup__hd p { font-size: 14px; text-wrap: pretty; }
.lookup__form { padding: 16px 20px 14px; }
.lookup__label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.lookup__field { position: relative; display: flex; height: 54px; }
.lookup__field input { flex: 1; min-width: 0; padding: 0 16px; border: 2px solid var(--navy); border-right: 0; border-radius: var(--r) 0 0 var(--r); background: var(--field); color: var(--ink); font-size: 17px; font-weight: 500; outline: none; transition: box-shadow .15s; }
:root[data-theme="dark"] .lookup__field input { border-color: #3b4b68; }
.lookup__field input::placeholder { color: #6b7282; font-weight: 400; }
:root[data-theme="dark"] .lookup__field input::placeholder, :root[data-theme="dark"] .login input::placeholder, :root[data-theme="dark"] .oneline__field input::placeholder, :root[data-theme="dark"] .drawer__search input::placeholder { color: #8f98a8; }
.lookup__field:focus-within input { box-shadow: 0 0 0 3px #caf88799; }
.lookup__btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 24px; border: 2px solid var(--navy); border-radius: 0 var(--r) var(--r) 0; background: var(--lime); color: var(--navy); font-size: 16.5px; font-weight: 800; white-space: nowrap; transition: background .15s; }
:root[data-theme="dark"] .lookup__btn { border-color: var(--lime); }
.lookup__btn:hover { background: var(--lime-hi); }
.lookup__btn .i { stroke-width: 2.2; }
.lookup__hint { margin-top: 9px; font-size: 13px; color: var(--ink-3); }
.linkish { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lookup__stats { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 12px 20px 13px; border-top: 1px solid var(--line); background: var(--panel-2); }
.lookup__stats dl { display: flex; }
.lookup__stats dl > div { padding-right: 22px; margin-right: 22px; border-right: 1px solid var(--line-2); }
.lookup__stats dl > div:last-child { margin-right: 0; border-right: 0; }
.lookup__stats dt { font-size: 12.5px; color: var(--ink-3); }
.lookup__stats dd { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lookup__stats dd b { margin-right: 2px; color: var(--ink); font: 800 22px/1.15 var(--font-en); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lookup__asof { font-size: 12px; color: var(--ink-3); text-align: right; }

/* 자동완성 */
.ac { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25; background: var(--panel); border: 1px solid var(--line-2); border-top: 2px solid var(--rule); box-shadow: var(--shadow-pop); }
.ac__head { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.ac__opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; width: 100%; padding: 10px 14px; text-align: left; cursor: pointer; }
.ac__opt + .ac__opt { border-top: 1px solid var(--line); }
.ac__opt[aria-selected="true"], .ac__opt:hover { background: var(--hover); }
.ac__opt > .i { grid-row: 1 / span 2; width: 20px; height: 20px; color: var(--ink-3); }
.ac__co { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.ac__co mark { background: none; color: var(--accent-ink); }
.ac__meta { grid-column: 2; min-width: 0; overflow: hidden; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; text-overflow: ellipsis; }
.ac__meta code { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.ac__cnt { grid-column: 3; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 2px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ac__cnt b { color: var(--ink); font: 800 14px var(--font-en); }
.ac__cnt small { font-size: 12px; color: var(--ink-3); }
.ac__foot { display: flex; gap: 7px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.ac__foot .i { width: 16px; height: 16px; margin-top: 1px; color: var(--ink-3); }
.ac__empty { padding: 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.ac__empty b { color: var(--ink); }

/* ---------- 실시간 인기글 ---------- */
.hot__list { padding: 5px 0 6px; counter-reset: hot; }
.hot__row { position: relative; display: grid; grid-template-columns: 26px 88px minmax(0, 1fr) 64px; align-items: center; column-gap: 12px; height: 40px; padding: 0 16px; }
.hot__row:hover { background: var(--hover); }
.hot__row .rank { justify-self: center; color: var(--ink-3); font: 700 14px/1 var(--font-en); }
.hot__row .rank.is-top { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--navy); color: var(--lime); font-size: 13px; font-weight: 800; }
:root[data-theme="dark"] .hot__row .rank.is-top { background: var(--lime); color: var(--navy); }
.hot__board { overflow: hidden; color: var(--ink-3); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.hot__row .ttl::after, .case .ttl::after, .brow .ttl::after, .rlist .rnick::after { content: ""; position: absolute; inset: 0; }
.hot__row:has(.ttl:focus-visible), .case:has(.ttl:focus-visible), .brow:has(.ttl:focus-visible), .rlist li:has(.rnick:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.hot__list.is-swap { animation: swap .22s ease-out; }
@keyframes swap { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 최근 공개된 피해 사례 ---------- */
.case-list { padding: 2px 0; }
.case { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) 148px 80px 40px; grid-template-areas: "k t c e d"; align-items: center; column-gap: 12px; min-height: 46px; padding: 0 16px; }
.case + .case { border-top: 1px solid var(--line); }
.case:hover { background: var(--hover); }
.ctype { grid-area: k; justify-self: start; padding: 3px 7px; border-radius: var(--r-sm); background: var(--chip); color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.case .ttl { grid-area: t; }
.case__co { grid-area: c; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.case__co .i { width: 15px; height: 15px; color: var(--ink-3); }
.case__co span { overflow: hidden; text-overflow: ellipsis; }
.case__co.is-hidden { color: var(--ink-3); }
.case .ebadge { grid-area: e; justify-self: start; }
.case time { grid-area: d; color: var(--ink-3); font: 600 12px/1 var(--font-en); text-align: right; }
.cases__note { display: flex; align-items: center; gap: 6px; padding: 10px 16px 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }
.cases__note .i { width: 15px; height: 15px; }

/* ---------- 게시판별 최신글 ---------- */
.bundles { display: grid; gap: 12px; }
.bundles__hd { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.bundles__hd h2 { font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.bundles__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bundle { background: var(--panel); border: 1px solid var(--line-2); border-top: 2px solid var(--rule); }
.bundle__hd { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.bundle__hd h3 { flex: none; font-size: inherit; }
.bundle__name { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 15.5px; font-weight: 800; letter-spacing: -.03em; }
.bundle__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.bundle__name .i { width: 16px; height: 16px; color: var(--ink-3); }
.bundle__desc { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.bundle__go { display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-right: -6px; border-radius: var(--r); color: var(--ink-3); }
.bundle__go:hover { background: var(--hover); color: var(--ink); }
.brows { padding: 5px 0 6px; }
.brow { position: relative; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; }
.brow:hover { background: var(--hover); }
.brow .ttl { flex: 1; font-size: 14.5px; }
.brow time { flex: none; width: 38px; color: var(--ink-3); font: 600 12px/1 var(--font-en); text-align: right; }
.bundle--locked .bundle__hd .lv { margin-left: -2px; }
.bundle--locked .ttl { color: var(--ink-2); }
.bundle--locked .ttl > .i { width: 15px; height: 15px; margin-right: 6px; color: var(--ink-3); }
.bundle__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px 10px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--ink-3); font-size: 12.5px; }
.bundle__foot button { flex: none; color: var(--accent-ink); font-weight: 700; }

.btabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 2px; scrollbar-width: none; }
.btabs::-webkit-scrollbar { display: none; }
.btabs button { flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--ink-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
.btabs button[aria-pressed="true"] { border-color: var(--btn); background: var(--btn); color: #fff; }
.btabs button .i { width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; }

/* ---------- 사이드: 로그인 · 내 활동 ---------- */
.login { display: grid; gap: 6px; padding: 14px 16px 12px; }
.login label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.login input, .oneline__field input { height: 40px; min-width: 0; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--field); color: var(--ink); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
.login input:focus, .oneline__field input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px #caf88780; }
.login input + label { margin-top: 4px; }
.login .btn { margin-top: 8px; }
.login__links { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.login__links a:hover { color: var(--ink); }
.me__note { display: flex; align-items: flex-start; gap: 6px; padding: 10px 16px 11px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.me__note .i { width: 15px; height: 15px; margin-top: 1px; color: var(--accent-ink); }
.me__body { padding: 14px 16px; }
.me__who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.me__who b { font-size: 17px; letter-spacing: -.03em; }
.me__lvname { color: var(--ink-3); font-size: 12.5px; }
.me__prog .meter { margin-top: 12px; }
.me__prog p { margin-top: 6px; color: var(--ink-2); font-size: 13px; }
.me__prog b { color: var(--ink); }
.me__stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); }
.me__stats div { padding: 8px 6px; text-align: center; }
.me__stats div + div { border-left: 1px solid var(--line); }
.me__stats dt { color: var(--ink-3); font-size: 12px; }
.me__stats dd { font: 800 18px/1.3 var(--font-en); font-variant-numeric: tabular-nums; }
.me__stats small { margin-left: 1px; color: var(--ink-3); font: 600 12px var(--font); }
.me__month { margin-top: 10px; color: var(--ink-2); font-size: 13px; }
.me__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

/* 주간 랭킹 */
.rlist { padding: 6px 0; }
.rlist li { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; }
.rk { width: 20px; flex: none; color: var(--ink-3); font: 800 14px/1 var(--font-en); text-align: center; }
.rlist li:nth-child(-n+3) .rk { color: var(--ink); }
.rlist li:first-child .rk { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--lime); color: var(--navy); }
.rnick { min-width: 0; overflow: hidden; font-size: 14.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.rnick:hover { text-decoration: underline; text-underline-offset: 3px; }
.rpts { margin-left: auto; flex: none; color: var(--ink-2); font: 700 13px/1 var(--font-en); }

/* 통계 막대 */
.sbars { display: grid; gap: 12px; padding: 14px 16px 12px; }
.sbars li { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; align-items: baseline; }
.sbars .k { font-size: 13.5px; font-weight: 700; }
.sbars .v { color: var(--ink-2); font: 700 13px/1 var(--font-en); }
.sbars .v small { margin-left: 4px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.sbars .bar { grid-column: 1 / -1; width: var(--w); height: 8px; border-radius: 2px; background: var(--bar); }

/* 한 줄 제보 */
.oneline__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 16px 14px; }
.oneline__form label { color: var(--ink-2); font-size: 13.5px; font-weight: 700; }
.oneline__field { display: flex; gap: 6px; }
.oneline__field input { flex: 1; }
.oneline__field .btn { flex: none; padding: 0 14px; }
.oneline__msg { color: var(--ink-3); font-size: 12.5px; line-height: 1.55; text-wrap: pretty; }
.oneline__msg.is-error { color: var(--err); }
.oneline__msg mark { padding: 0 3px; border-radius: 2px; background: var(--err-bg); color: var(--err); font-weight: 700; }
.oneline__msg.is-ok { color: var(--accent-ink); font-weight: 600; }
.oneline__field input.is-error { border-color: var(--err); }

/* 투표 */
.poll__form { display: grid; gap: 10px; padding: 12px 16px 14px; }
.poll fieldset { min-width: 0; padding: 0; border: 0; }
.poll legend { margin-bottom: 8px; padding: 0; font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.poll__opts { display: grid; gap: 6px; }
.popt { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 14px; line-height: 1.4; cursor: pointer; transition: border-color .15s, background .15s; }
.popt:hover { border-color: var(--ink-3); }
.popt:has(input:checked) { border-color: var(--ink); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--ink); }
.popt input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--leaf); }
.poll__result { display: grid; gap: 11px; padding: 14px 16px; }
.pres { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; align-items: baseline; font-size: 14px; }
.pres .v { font: 800 13.5px/1 var(--font-en); }
.pres .bar { grid-column: 1 / -1; width: var(--w); height: 8px; border-radius: 2px; background: var(--line-2); transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.pres.is-mine .bar { background: var(--bar); }
.pres.is-mine .k { font-weight: 700; }
.pres.is-mine .k::after { content: "내 선택"; margin-left: 6px; padding: 1px 5px; border-radius: var(--r-sm); background: var(--lime); color: var(--navy); font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.poll__q { font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.poll__done { color: var(--ink-3); font-size: 12.5px; }

/* ---------- 반응형(메인 전용) ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 296px; gap: 20px; }
  .hot__row { grid-template-columns: 26px 80px minmax(0, 1fr) 60px; column-gap: 10px; }
  .case { grid-template-columns: 78px minmax(0, 1fr) 132px 78px 38px; column-gap: 10px; }
}
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 768px) {
  /* 짧은 보조 문구(기간·참여 수·로그인 없이)는 시안처럼 제목 옆 한 줄에 둔다 */
  .ranking .panel__hd .panel__sub, .oneline .panel__hd .panel__sub, .poll .panel__hd .panel__sub { flex: 0 1 auto; order: 0; padding-bottom: 0; white-space: nowrap; }
  .layout { width: 100%; gap: 8px; padding-block: 8px 12px; }
  .col-main, .col-side { gap: 8px; }
  .col-side { grid-template-columns: minmax(0, 1fr); }
  .col-side > .me.guest-only { display: none; }
  .bundle { border-right: 0; border-left: 0; }
  .lookup__hd { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 0; padding: 12px 16px; }
  .lookup__hd h2 { font-size: 17px; }
  .lookup__hd p { font-size: 13px; }
  .lookup__form { padding: 14px 16px 12px; }
  .lookup__field { height: 50px; }
  .lookup__field input { padding: 0 12px; font-size: 16px; }
  .lookup__btn { padding: 0 16px; font-size: 16px; }
  .lookup__stats { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 16px; }
  .lookup__stats dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lookup__stats dl > div { margin-right: 0; padding-right: 8px; }
  .lookup__stats dl > div + div { padding-left: 12px; }
  .lookup__stats dd b { font-size: 19px; }
  .lookup__asof { text-align: left; }
  .case { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "t t t t" "k c e d"; row-gap: 7px; column-gap: 8px; padding: 11px 16px; }
  .case__co { font-size: 13px; }
  .bundles { gap: 8px; }
  .bundles__hd { padding: 10px 16px 0; }
  .bundles__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bundle { display: none; }
  .bundle.is-active { display: block; }
  .linkish { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .nlist a { min-height: 44px; padding-block: 10px; }
  .popt { min-height: 46px; }
  .btabs button { height: 42px; padding: 0 14px; }
  .flist a { min-height: 56px; }
}
@media (max-width: 560px) {
  .hot__row { grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; height: 42px; }
  .hot__board, .hot__row .like { display: none; }
  .panel__hd .seg { margin-left: auto; }
  .panel__hd .seg + .panel__more { display: none; }
}
@media (max-width: 380px) {
  .lookup__stats dd b { font-size: 17px; }
  .lookup__btn .i { display: none; }
  .brow time { display: none; }
}
