:root {
  --brand: #ff5c35;
  --brand-dark: #e64a24;
  --brand-soft: #fff1ed;
  --grad: linear-gradient(135deg, #ff5c35 0%, #ff8a5c 100%);
  --grad-ai: linear-gradient(120deg, #7c5cff, #ff5c9e 50%, #ff8a5c);
  --shadow-pop: 0 10px 30px -8px rgba(255, 92, 53, .45);
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(255, 255, 255, .55);
  --navy: #17202e;
  --text: #232a35;
  --text-sub: #6b7684;
  --text-faint: #99a1ad;
  --line: #e9edf2;
  --bg: #f7f8fa;
  --card: #ffffff;
  --green: #12b76a;
  --green-soft: #e8f9f1;
  --red: #f04438;
  --red-soft: #fdeceb;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: 'Pretendard', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }

/* ---------- 헤더 ---------- */
.header {
  background: rgba(23, 32, 46, .88);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo { display: flex; align-items: center; gap: 4px; min-width: 0; }
.logo-img { flex-shrink: 0; }
.logo-mark {
  font-size: 25px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}
.logo-slogan {
  font-size: 12px;
  color: #8b95a5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-nickname { color: #cdd4de; font-size: 14px; margin-right: 4px; }
.btn-nav {
  background: transparent;
  border: 1px solid #3a4556;
  color: #cdd4de;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.btn-nav:hover { border-color: #5b6677; color: #fff; }
.btn-nav.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-nav.primary:hover { background: var(--brand-dark); }

/* ---------- 헤더 상시 검색 (다크 헤더 위 글래스 pill + 커스텀 카테고리 셀렉트) ---------- */
.header-search { flex: 1; max-width: 440px; min-width: 0; }
.hs-form {
  display: flex; align-items: stretch;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  overflow: visible;
  transition: background .15s, border-color .15s;
}
.hs-form:focus-within { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); }
.hs-cat { flex-shrink: 0; display: flex; }
.hs-cat .uk-select { display: flex; }
.hs-cat .uk-select-trigger {
  min-height: 0; height: 100%; border: none; background: transparent;
  border-radius: 12px 0 0 12px; padding: 0 8px 0 13px; gap: 5px;
  color: #fff; font-size: 14px;
}
.hs-cat .uk-select-trigger:hover { background: rgba(255, 255, 255, .08); }
.hs-cat .uk-select.open .uk-select-trigger { box-shadow: none; border: none; }
.hs-cat .uk-select-label { color: #fff; font-weight: 700; }
.hs-cat .uk-select-label .ph { color: rgba(255, 255, 255, .9); font-weight: 700; }
.hs-cat .uk-select-caret { color: rgba(255, 255, 255, .7); }
.hs-field { position: relative; flex: 1; display: flex; align-items: center; border-left: 1px solid rgba(255, 255, 255, .18); }
.hs-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .6); display: flex; pointer-events: none; }
.hs-input {
  width: 100%; min-width: 0; background: transparent; border: none; outline: none;
  padding: 10px 12px 10px 36px; color: #fff; font-size: 14px;
}
.hs-input::placeholder { color: rgba(255, 255, 255, .55); }

@media (max-width: 680px) {
  .header-inner { flex-wrap: wrap; }
  .logo { order: 1; }
  .header-nav { order: 2; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; margin-top: 10px; }
}

/* ---------- 게시판 탭 ---------- */
/* 카테고리 탭 — 평소엔 숨김(헤더 뒤), 스크롤로 배너가 가려지면 body.nav-stuck 으로 슬라이드 노출.
   바 자체가 가장자리에 붙지 않고 둥근 캡슐로 떠 있는 느낌(floating) */
.board-tabs {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--header-h, 70px) + 12px); /* 헤더에서 살짝 띄워 떠있는 느낌 */
  z-index: 40;
  transform: translateY(-150%); /* 헤더 뒤로 밀어 숨김 */
  opacity: 0;
  pointer-events: none; /* 투명 래퍼 — 클릭은 캡슐(inner)만 */
  transition: transform .34s cubic-bezier(.34, 1.4, .5, 1), opacity .22s ease;
}
body.nav-stuck .board-tabs {
  transform: translateY(0);
  opacity: 1;
}
.board-tabs-inner {
  width: max-content;
  max-width: calc(100% - 28px);
  margin: 0 auto;
  padding: 8px 11px;
  display: flex;
  gap: 7px;
  align-items: center;
  pointer-events: auto;
  overflow-x: auto;
  scrollbar-width: none;
  /* 리퀴드 글래스 — 뒷배경 비치는 반투명 + 강한 블러 + 밝은 림 하이라이트 */
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  box-shadow:
    0 14px 38px -10px rgba(23, 32, 46, .32),
    0 3px 8px rgba(23, 32, 46, .08),
    inset 0 1px 0 rgba(255, 255, 255, .7);
}
.board-tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 17px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background .15s, color .15s, box-shadow .15s;
}
.tab img { width: 22px; height: 22px; }
/* 인라인 배지/제목 안의 아이콘 */
.bicon { vertical-align: -3px; }
.badge .bicon { vertical-align: baseline; margin: 0; }
/* Lucide 라인 아이콘 */
.i { display: inline-block; vertical-align: -0.16em; flex-shrink: 0; }
.tab:hover { background: rgba(255, 255, 255, .85); color: var(--navy); transform: translateY(-1px); }
.tab.active,
.tab.active:hover {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 15px -4px rgba(255, 92, 53, .55);
  transform: translateY(-1px) scale(1.03);
}

/* ---------- 레이아웃 ---------- */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: 60vh;
}

/* ---------- 히어로 ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2a3648 100%);
  border-radius: 20px;
  overflow: hidden;
  padding: 36px 32px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero > * { position: relative; z-index: 1; }
.hero-glow {
  position: absolute; inset: -40%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 42% at 78% 18%, rgba(255, 92, 53, .38), transparent 70%),
    radial-gradient(30% 34% at 12% 82%, rgba(92, 141, 239, .3), transparent 70%),
    radial-gradient(24% 28% at 55% 55%, rgba(255, 138, 92, .16), transparent 70%);
  animation: hero-float 9s ease-in-out infinite alternate;
}
@keyframes hero-float {
  0%   { transform: translate3d(-2%, -1%, 0) rotate(-1.5deg) scale(1); }
  100% { transform: translate3d(2%, 2%, 0) rotate(1.5deg) scale(1.06); }
}
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.35; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p { color: #aab4c3; margin-top: 8px; font-size: 15px; }
.hero-boards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 24px; }
.hero-board {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  transition: all .15s;
}
.hero-board:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }
.hero-board .emoji { font-size: 24px; display: block; }
.hero-board img { width: 48px; height: 48px; display: block; margin: 0 auto 4px; }
.hero-board .name { font-size: 14px; font-weight: 700; margin-top: 6px; display: block; }
.hero-board .q {
  font-size: 11px; color: #8b95a5; display: block; margin-top: 2px;
  line-height: 1.35;
  min-height: 2.7em;        /* 2줄 공간 고정 → 카드 높이 균일 */
  word-break: keep-all;     /* 한국어 어절 단위 줄바꿈 (단어 중간 안 깨짐) */
}
/* 히어로 보드: 데스크톱 6 · 태블릿 3 · 모바일 2 (짝수로 깔끔하게 떨어지게) */
@media (max-width: 900px) { .hero-boards { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 게시판 헤더 ---------- */
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.board-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; }
.board-head .board-q { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.board-head-actions { display: flex; gap: 8px; align-items: center; }

/* 검색 바 — 카테고리 셀렉트 + 검색어 + 버튼 */
.search-bar { display: flex; gap: 8px; margin-bottom: 18px; align-items: stretch; }
.search-cat { position: relative; flex-shrink: 0; }
.search-cat select {
  appearance: none; -webkit-appearance: none;
  height: 100%; padding: 0 34px 0 15px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.search-cat select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.15); }
.search-cat-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; display: flex; }
.search-field { position: relative; flex: 1; display: flex; }
.search-field-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; display: flex; }
.search-field input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.search-field input::placeholder { color: var(--text-faint); }
.search-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.15); }
.search-go { flex-shrink: 0; }
.board-head-count { font-size: 15px; font-weight: 800; color: var(--brand); margin-left: 4px; }
/* 글 카드의 게시판 태그 → 클릭 시 해당 카테고리로 이동 */
.badge-board { cursor: pointer; transition: background .12s, color .12s, transform .12s; }
.badge-board:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
@media (max-width: 520px) {
  .search-go { padding-left: 15px; padding-right: 15px; }
  .search-cat select { padding-left: 12px; padding-right: 30px; font-size: 13px; }
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  transition: all .12s;
}
.btn:hover { background: var(--bg); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(23,32,46,.10); }
.btn.primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn.primary:active { background: var(--brand-dark); transform: translateY(0) scale(.97); }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 글 목록 ---------- */
.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  transition: all .12s;
}
.post-card:hover { border-color: #ffc7b3; box-shadow: 0 10px 28px -10px rgba(23,32,46,.16); transform: translateY(-2px); }
/* 운영자 공지 글: 살짝 옅은 주황 배경으로 강조 */
.post-card.notice { background: var(--brand-soft); border-color: #ffd0bf; }
.post-card.notice:hover { border-color: #ffb499; }
.post-detail.notice { background: var(--brand-soft); border-color: #ffd0bf; }
.badge.notice-badge { background: var(--brand); color: #fff; }
.post-card { animation: fade-up .4s cubic-bezier(.2,.7,.3,1) both; }
.post-card:nth-child(1) { animation-delay: .02s; } .post-card:nth-child(2) { animation-delay: .06s; }
.post-card:nth-child(3) { animation-delay: .1s; }  .post-card:nth-child(4) { animation-delay: .14s; }
.post-card:nth-child(5) { animation-delay: .18s; } .post-card:nth-child(6) { animation-delay: .22s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.post-card-body { flex: 1; min-width: 0; }
.post-card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  align-items: center;
}
.post-card-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  line-height: 1;
}
.badge.price { background: #eef4ff; color: #3563e9; }
.badge.region { background: #f1f3f6; color: var(--text-sub); }

/* 투표 미니 게이지 */
.verdict-mini { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.verdict-mini .bar {
  width: 64px; height: 6px; border-radius: 3px;
  background: var(--red); overflow: hidden; display: inline-block;
}
.verdict-mini .bar i { display: block; height: 100%; background: var(--green); }
.verdict-mini .pct-yes { color: var(--green); }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}
.empty .big { font-size: 40px; margin-bottom: 10px; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination button {
  min-width: 36px; height: 36px; padding: 0 6px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.pagination button:hover { border-color: var(--brand); color: var(--brand-dark); }
.pagination button.cur { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination button.cur:hover { color: #fff; }
.pagination .pg-arrow { font-size: 17px; line-height: 1; color: var(--text-sub); }
.pagination .pg-dots { color: var(--text-faint); padding: 0 2px; font-weight: 700; }

/* ---------- 글 상세 ---------- */
.post-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.post-detail-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.post-detail-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.4; margin-top: 8px; }
.post-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-faint); align-items:center; }
.post-info-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.info-chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}
.info-chip b { color: var(--text-sub); font-weight: 600; margin-right: 6px; font-size: 12px; }
.post-content { padding: 22px 0; font-size: 15.5px; white-space: pre-wrap; word-break: break-word; }
.post-images { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 20px; }
.post-images img {
  max-width: 100%;
  width: 340px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

/* 최종 판단 투표 */
.verdict-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.verdict-box h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.verdict-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verdict-btn {
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  border: 1.5px solid var(--line);
  background: var(--card);
  transition: all .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.verdict-btn.yes { color: var(--green); }
.verdict-btn.no { color: var(--red); }
.verdict-btn.yes.sel, .verdict-btn.yes:hover { background: var(--green-soft); border-color: var(--green); }
.verdict-btn.no.sel, .verdict-btn.no:hover { background: var(--red-soft); border-color: var(--red); }
.verdict-gauge { margin-top: 14px; }
.verdict-gauge .track {
  height: 10px; border-radius: 5px; background: var(--red); overflow: hidden;
}
.verdict-gauge .track i { display: block; height: 100%; background: var(--green); }
.verdict-gauge .labels {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 13px; font-weight: 700;
}
.verdict-gauge .labels .l-yes { color: var(--green); }
.verdict-gauge .labels .l-no { color: var(--red); }

/* 시세 제보 요약 */
.price-stats {
  background: #eef4ff;
  border: 1px solid #d5e2fb;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
}
.price-stats b { color: #3563e9; }
.price-stats .row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 6px; font-size: 15px; font-weight: 700; }

/* ---------- 댓글 ---------- */
.comments { margin-top: 24px; }
.comments h3 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head .nick { font-weight: 700; color: var(--text); }
.comment-head .time { color: var(--text-faint); font-size: 12px; }
.comment-body { margin-top: 4px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.comment .price-tag {
  display: inline-block;
  background: #eef4ff; color: #3563e9;
  font-size: 12px; font-weight: 800;
  padding: 2px 8px; border-radius: 6px;
}
.comment-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.comment-form textarea {
  width: 100%; min-height: 80px; resize: vertical;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
}
.comment-form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.comment-form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 시세 제보 인풋 — 코인 + 단위 라벨이 든 커스텀 pill (네이티브 스피너 제거) */
.price-wrap {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 13px; border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.price-wrap .i { color: var(--brand); flex-shrink: 0; }
.price-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.14); }
.price-wrap .price-input {
  width: 158px; border: none; outline: none; background: transparent;
  padding: 11px 0; font-size: 14px; font-weight: 700;
}
.price-wrap .price-input::placeholder { font-weight: 500; color: var(--text-faint); }
.price-unit { font-size: 12.5px; font-weight: 800; color: var(--text-sub); flex-shrink: 0; }
/* number 인풋 위아래 화살표 전역 제거 */
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.comment-form-row .hint { font-size: 12px; color: var(--text-faint); }
.login-cta {
  text-align: center; padding: 24px; background: var(--bg);
  border-radius: 10px; color: var(--text-sub); font-size: 14px; margin-top: 16px;
}

/* ---------- 폼 (글쓰기/로그인) ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 640px;
  margin: 0 auto;
}
/* 글쓰기 폼은 넓게 (입력이 많아 답답하지 않게) */
.form-card.form-card-wide {
  max-width: 820px;
  padding: 32px 36px;
}
.form-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.form-card .sub { font-size: 13.5px; color: var(--text-sub); margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field label .req { color: var(--brand); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--brand); outline-offset: -1px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field .help { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.notice {
  background: var(--brand-soft);
  border: 1px solid #ffd9cc;
  color: var(--brand-dark);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.55;
}
.board-select { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.board-select button {
  padding: 12px 4px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 13px; font-weight: 700;
}
.board-select button .emoji { display: block; font-size: 20px; margin-bottom: 2px; }
.board-select button img { width: 30px; height: 30px; display: block; margin: 0 auto 3px; }
.board-select button.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-sub); }
.auth-switch a { color: var(--brand); font-weight: 700; }
.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; min-width: 0; }
.phone-row .btn { flex-shrink: 0; white-space: nowrap; }

/* 인라인 폼 검증 */
.field .field-error { display: none; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--red); }
.field .field-error.show { display: block; }
.field input.invalid { border-color: var(--red); }
.field input.invalid:focus { outline-color: var(--red); }
.field .caps-warn {
  display: none; margin-top: 5px; font-size: 12px; font-weight: 600; color: #b7791f;
  align-items: center; gap: 4px;
}
.field .caps-warn.show { display: flex; }
.field input.valid { border-color: var(--green); }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 100;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 푸터 ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 20px 52px;
  background: linear-gradient(180deg, var(--card), #fbfcfd);
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-brand img { border-radius: 7px; }
.footer-name { font-size: 17px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); }
.footer-tag { font-size: 13px; color: var(--text-sub); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  transition: all .14s;
}
.footer-links a:hover { border-color: #ffc7b3; color: var(--brand); background: var(--brand-soft); }
.footer-ui { color: var(--text-faint); }
.footer-copy { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ---------- 반응형 ---------- */
@media (max-width: 640px) {
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 21px; }
  .hero-boards { grid-template-columns: repeat(2, 1fr); }
  .logo-slogan { display: none; }
  .post-detail { padding: 20px; }
  .form-card { padding: 20px; }
  .board-select { grid-template-columns: repeat(3, 1fr); }
  .post-card-thumb { width: 60px; height: 60px; }
}

/* ---------- 전역 로딩 오버레이 (달리는 자동차) ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .45s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-overlay .loader { width: min(520px, 92vw); text-align: center; }
.loading-overlay .scene {
  position: relative;
  height: 150px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.loading-overlay .road {
  position: absolute; left: 0; right: 0; bottom: 34px; height: 3px;
  background: repeating-linear-gradient(to right, rgba(255,255,255,.18) 0 22px, transparent 22px 40px);
  animation: ld-road .5s linear infinite;
}
@keyframes ld-road { to { background-position-x: -40px; } }
.loading-overlay .lane {
  position: absolute; bottom: 20px; width: 120px; height: 120px;
  animation: ld-drive 2.6s cubic-bezier(.45,.05,.55,.95) infinite;
  will-change: left, transform, opacity;
}
@keyframes ld-drive {
  0%   { left: 100%; transform: scale(.35); opacity: 0; }
  14%  { opacity: 1; }
  52%  { left: 40%;  transform: scale(1); }
  86%  { opacity: 1; }
  100% { left: -32%; transform: scale(.92); opacity: 0; }
}
.loading-overlay .car {
  width: 100%; height: 100%; object-fit: contain;
  animation: ld-bob .16s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
@keyframes ld-bob {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50%      { transform: translateY(-2.5px) rotate(.6deg); }
}
.loading-overlay .speed { position: absolute; top: 34%; right: -6px; width: 60px; }
.loading-overlay .speed span {
  display: block; height: 4px; border-radius: 4px; margin: 7px 0;
  background: linear-gradient(to right, transparent, var(--brand));
  opacity: 0; animation: ld-streak .55s linear infinite;
}
.loading-overlay .speed span:nth-child(1) { width: 46px; animation-delay: 0s; }
.loading-overlay .speed span:nth-child(2) { width: 60px; animation-delay: .12s; }
.loading-overlay .speed span:nth-child(3) { width: 38px; animation-delay: .24s; }
@keyframes ld-streak {
  0%   { opacity: 0; transform: translateX(-6px); }
  40%  { opacity: .9; }
  100% { opacity: 0; transform: translateX(26px); }
}
.loading-overlay .puff { position: absolute; right: 2px; bottom: 24px; }
.loading-overlay .puff i {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,.22); animation: ld-puff .7s ease-out infinite;
}
.loading-overlay .puff i:nth-child(2) { animation-delay: .35s; }
@keyframes ld-puff {
  0%   { transform: translate(0,0) scale(.4); opacity: .5; }
  100% { transform: translate(22px,-10px) scale(1.4); opacity: 0; }
}
.loading-overlay .brand { margin-top: 14px; font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: #fff; }
.loading-overlay .brand .ka { color: var(--brand); }
.loading-overlay .status { margin-top: 6px; font-size: 14px; color: #8b95a5; font-weight: 600; }
.loading-overlay .status b { color: #cdd4de; font-weight: 700; }
.loading-overlay .dots i { animation: ld-blink 1.2s infinite; }
.loading-overlay .dots i:nth-child(2) { animation-delay: .2s; }
.loading-overlay .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ld-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- 아바타 (클레이 캐릭터) ---------- */
.avatar { border-radius: 50%; flex-shrink: 0; vertical-align: middle; display: inline-block; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; user-select: none;
}
.meta-user { display: inline-flex; align-items: center; gap: 5px; }
.nav-profile {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 4px; border-radius: 99px;
  border: 1px solid #3a4556; transition: all .15s;
}
.nav-profile:hover { border-color: var(--brand); background: rgba(255,92,53,.12); }
.nav-profile .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.15); }

/* ---------- 프로필 페이지 (캐릭터 빌더 + 내 차) ---------- */
/* 세로 스택 — 카드끼리 높이 경쟁 없음. 빌더 안에서만 좌(미리보기)/우(옵션) 2분할 */
.profile-page { display: flex; flex-direction: column; gap: 16px; }
.profile-page > .form-card { min-width: 0; max-width: none; width: 100%; margin: 0; }
.builder-head { margin-bottom: 16px; }
.builder-head .sub { margin-bottom: 0; }
.builder { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.builder-side {
  position: sticky; top: calc(var(--header-h, 70px) + 60px);
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
}
.builder-side .avatar-preview { margin: 0 auto 6px; }
.builder-main { min-width: 0; }
.builder-main .cat-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.builder-main .cat-tabs::-webkit-scrollbar { display: none; }
.builder-main .cat-tab { flex-shrink: 0; }
@media (max-width: 640px) {
  .builder { grid-template-columns: 1fr; gap: 14px; }
  .builder-side { position: static; }
}
.avatar-preview {
  width: 170px; height: 170px; margin: 6px auto 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 10px rgba(23,32,46,.05);
}
.avatar-preview.db { background: var(--bg); border: none; box-shadow: none; }
.avatar-preview.db img { width: 150px; height: 150px; image-rendering: pixelated; border-radius: 50%; animation: pop-in .3s cubic-bezier(.3,1.6,.5,1); }
.avatar-pixel { image-rendering: pixelated; }
/* 번호 칩 (많은 옵션 — 컴팩트 격자, 스크롤) */
.opt-row.chips-num { max-height: 132px; overflow-y: auto; }
.opt-row.chips-num .opt-chip { min-width: 34px; padding: 6px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.avatar-preview .avatar { animation: pop-in .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop-in { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.dice-btn { margin: 0 auto 14px; }

/* 아바타 카테고리 탭 (테라리아식) */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; justify-content: center; }
.cat-tab {
  padding: 7px 13px; border-radius: 99px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text-sub); transition: all .12s;
}
.cat-tab:hover { border-color: #ffc7b3; }
.cat-tab.sel { border-color: transparent; background: var(--grad); color: #fff; box-shadow: var(--shadow-pop); }
.cat-panel { animation: fade-up .25s ease both; }
.opt-row.swatches { gap: 8px; }
.opt-group { text-align: left; margin-bottom: 13px; }
.opt-label { font-size: 12.5px; font-weight: 700; color: var(--text-sub); margin-bottom: 6px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.08); cursor: pointer; transition: all .12s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); transform: scale(1.1); }
.opt-chip {
  padding: 6px 13px; border-radius: 99px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text-sub);
  transition: all .12s;
}
.opt-chip:hover { border-color: #ffc7b3; }
.opt-chip.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 차량 선택기 ---------- */
.car-picker-row { display: grid; grid-template-columns: 1.1fr 1.2fr .9fr; gap: 8px; }
.car-picker select { width: 100%; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.car-picker select:disabled { background: var(--bg); color: var(--text-faint); }
.car-picker .car-custom { width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.my-car-chip {
  margin-top: 9px; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  border: 1.5px dashed var(--brand); background: var(--brand-soft); color: var(--brand-dark);
  transition: all .12s;
}
.my-car-chip:hover { background: #ffe4d9; transform: translateY(-1px); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label .opt { color: var(--text-faint); font-weight: 500; font-size: 12px; }

/* ---------- 글쓰기 스텝 + AI 버튼 ---------- */
.write-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 800; margin: 22px 0 14px;
  padding-top: 18px; border-top: 1px dashed var(--line);
}
.write-step .n {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 12px;
}
.ai-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: none; border-radius: 99px;
  font-size: 13px; font-weight: 800; color: #fff;
  background: var(--grad-ai); background-size: 200% 200%;
  box-shadow: 0 6px 20px -6px rgba(124, 92, 255, .55);
  animation: ai-shimmer 3.2s ease infinite;
  transition: transform .12s;
}
.ai-btn:hover { transform: translateY(-1px) scale(1.02); }
.ai-btn:disabled { opacity: .75; cursor: wait; }
.ai-btn.loading { animation: ai-shimmer .9s linear infinite; }
@keyframes ai-shimmer { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ---------- TTS (읽어주는 커뮤니티) ---------- */
.post-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tts-wrap { display: inline-flex; align-items: center; gap: 6px; }
.tts-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text-sub);
  transition: all .15s;
}
.tts-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.tts-btn.speaking {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark);
  animation: tts-pulse 1.4s ease infinite;
}
@keyframes tts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,92,53,.35); }
  50% { box-shadow: 0 0 0 7px rgba(255,92,53,0); }
}
.tts-rate {
  padding: 7px 10px; border-radius: 99px; font-size: 12px; font-weight: 800;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text-faint);
}
.tts-rate:hover { color: var(--text); }

/* ---------- 대화하기 진입 버튼 ---------- */
.chat-open-btn { padding: 4px 12px !important; font-size: 12px !important; border-radius: 99px; gap: 4px; }
.comment-chat {
  border: none; background: transparent; color: var(--text-faint);
  padding: 3px 6px; border-radius: 6px; display: inline-flex; align-items: center;
  transition: all .12s;
}
.comment-chat:hover { color: var(--brand); background: var(--brand-soft); }

/* ---------- DM: 리퀴드 글래스 FAB + 패널 ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; border: 1px solid rgba(255,255,255,.5);
  background: linear-gradient(135deg, rgba(255,92,53,.92), rgba(255,138,92,.88));
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  box-shadow: 0 12px 32px -8px rgba(255,92,53,.55), inset 0 1px 1px rgba(255,255,255,.55);
  transition: transform .18s cubic-bezier(.3,1.5,.5,1), box-shadow .18s;
}
.chat-fab:hover { transform: scale(1.07) translateY(-2px); }
.chat-fab:active { transform: scale(.95); }
.chat-fab.open { background: linear-gradient(135deg, rgba(23,32,46,.92), rgba(42,54,72,.9)); }
.chat-fab.has-unread { animation: fab-ring 2.4s ease infinite; }
@keyframes fab-ring {
  0%, 100% { box-shadow: 0 12px 32px -8px rgba(255,92,53,.55), inset 0 1px 1px rgba(255,255,255,.55), 0 0 0 0 rgba(255,92,53,.4); }
  40% { box-shadow: 0 12px 32px -8px rgba(255,92,53,.55), inset 0 1px 1px rgba(255,255,255,.55), 0 0 0 12px rgba(255,92,53,0); }
}
.chat-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 21px; height: 21px; padding: 0 5px; border-radius: 99px;
  background: #f04438; color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.chat-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 200;
  width: 380px; height: min(560px, calc(100dvh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: 0 24px 64px -16px rgba(23,32,46,.35), inset 0 1px 1px rgba(255,255,255,.7);
  animation: panel-in .28s cubic-bezier(.25,1.4,.45,1);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(23,32,46,.08);
  background: rgba(255,255,255,.4);
}
.chat-head-title { flex: 1; font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-head-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back {
  border: none; background: transparent; font-size: 26px; line-height: 1;
  padding: 0 6px 3px 0; color: var(--text-sub); cursor: pointer;
}
.chat-close {
  border: none; background: rgba(23,32,46,.06); color: var(--text-sub);
  width: 28px; height: 28px; border-radius: 50%; font-size: 13px;
}
.chat-close:hover { background: rgba(23,32,46,.12); }

.chat-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.chat-empty { text-align: center; padding: 48px 24px; color: var(--text-faint); font-size: 13.5px; line-height: 1.7; }
.chat-empty .big { font-size: 34px; margin-bottom: 8px; }

.chat-list { display: flex; flex-direction: column; }
.chat-item {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 12px 16px; border: none; background: transparent;
  border-bottom: 1px solid rgba(23,32,46,.05); cursor: pointer;
}
.chat-item:hover { background: rgba(255,255,255,.55); }
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.chat-item-top time { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.chat-item-last {
  display: block; font-size: 12.5px; color: var(--text-sub); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item.unread .chat-item-last { color: var(--text); font-weight: 700; }
.chat-item-badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; flex-shrink: 0;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.chat-msgs { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; }
.msg-row { display: flex; align-items: flex-end; gap: 7px; max-width: 88%; }
.msg-row time { font-size: 10.5px; color: var(--text-faint); flex-shrink: 0; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  display: flex; flex-direction: column; gap: 6px;
  padding: 9px 13px; border-radius: 17px;
  background: rgba(255,255,255,.85); border: 1px solid rgba(23,32,46,.06);
  font-size: 14px; line-height: 1.5; word-break: break-word;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px -3px rgba(23,32,46,.1);
}
.msg-row.mine .msg-bubble {
  background: var(--grad); color: #fff; border: none;
  border-bottom-left-radius: 17px; border-bottom-right-radius: 6px;
}
.msg-text { white-space: pre-wrap; }
.msg-img { max-width: 200px; max-height: 220px; border-radius: 11px; cursor: zoom-in; display: block; }
.msg-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 11px;
  background: rgba(23,32,46,.06); color: inherit; font-size: 13px; font-weight: 600;
  max-width: 220px;
}
.msg-row.mine .msg-file { background: rgba(255,255,255,.22); }
.msg-file-ic { font-size: 19px; }
.msg-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-composer {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 12px;
  border-top: 1px solid rgba(23,32,46,.08);
  background: rgba(255,255,255,.5);
}
.chat-composer input[type="text"], .chat-composer #chat-input {
  flex: 1; min-width: 0; padding: 10px 15px;
  border: 1px solid rgba(23,32,46,.1); border-radius: 99px;
  background: rgba(255,255,255,.9); font-size: 14px;
}
.chat-composer #chat-input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.chat-attach, .chat-send {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; border: none;
}
.chat-attach { background: rgba(23,32,46,.06); color: var(--text-sub); }
.chat-attach:hover { background: rgba(23,32,46,.12); color: var(--text); }
.chat-send { background: var(--grad); color: #fff; box-shadow: 0 4px 14px -4px rgba(255,92,53,.6); }
.chat-send:hover { filter: brightness(1.06); }
.chat-composer.sending { opacity: .6; pointer-events: none; }

/* ---------- 모션 최소화 존중 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-glow, .post-card, .ai-btn, .tts-btn.speaking, .chat-fab.has-unread, .avatar-preview .avatar { animation: none !important; }
}

/* ---------- 반응형 (신규 컴포넌트) ---------- */
@media (max-width: 640px) {
  .profile-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .car-picker-row { grid-template-columns: 1fr; }
  .nav-nickname { display: none; }
  .chat-panel {
    right: 0; left: 0; bottom: 0; width: 100%;
    height: min(86dvh, 640px);
    border-radius: 24px 24px 0 0;
  }
  .chat-fab { right: 16px; bottom: 16px; }
  .post-detail-top { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================
   UI 킷 (window.UI) — 모달 · 시트 · 팝오버 · 셀렉트 · 캘린더 등
   ========================================================== */

/* ----- 오버레이 ----- */
.uk-overlay {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(23, 32, 46, .38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s ease;
  display: flex;
}
.uk-overlay.show { opacity: 1; }
.uk-overlay.uk-center { align-items: center; justify-content: center; padding: 20px; }
.uk-overlay.uk-bottom { align-items: flex-end; }

/* ----- 모달 ----- */
.uk-modal {
  width: min(400px, 100%);
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  padding: 24px 22px 18px;
  box-shadow: 0 30px 70px -20px rgba(23,32,46,.45), inset 0 1px 1px rgba(255,255,255,.7);
  transform: translateY(14px) scale(.94);
  opacity: 0;
  transition: transform .32s cubic-bezier(.25,1.5,.4,1), opacity .22s;
}
.uk-overlay.show .uk-modal { transform: none; opacity: 1; }
.uk-modal-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 8px; }
.uk-modal-msg { font-size: 14.5px; color: var(--text-sub); line-height: 1.65; }
.uk-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ----- UI 킷 버튼 ----- */
.uk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 11px;
  font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  transition: transform .12s, filter .12s, background .12s;
}
.uk-btn:hover { transform: translateY(-1px); }
.uk-btn:active { transform: scale(.96); }
.uk-btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-pop); }
.uk-btn.danger { background: var(--red); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -8px rgba(240,68,56,.6); }

/* ----- 바텀 시트 ----- */
.uk-sheet {
  width: 100%;
  max-height: 82dvh; overflow-y: auto;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-line); border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 6px 22px 30px;
  box-shadow: 0 -20px 60px -18px rgba(23,32,46,.4);
  transform: translateY(100%);
  transition: transform .38s cubic-bezier(.22,1.2,.36,1);
}
.uk-overlay.show .uk-sheet { transform: translateY(0); }
.uk-sheet-handle { padding: 10px 0 6px; cursor: grab; touch-action: none; }
.uk-sheet-handle:active { cursor: grabbing; }
.uk-sheet-handle i { display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(23,32,46,.18); margin: 0 auto; }
.uk-sheet-title { font-size: 16.5px; font-weight: 800; margin: 6px 0 10px; }

/* ----- 팝오버 ----- */
.uk-popover {
  position: fixed; z-index: 270;
  /* 밝은 배경 위에서도 카드로 확실히 보이도록 거의 불투명한 흰색 (기존 .72 글래스는 폼 위에서 투명하게 깨져 보임) */
  background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(23,32,46,.1);
  border-radius: 15px;
  box-shadow: 0 18px 50px -14px rgba(23,32,46,.35), inset 0 1px 1px rgba(255,255,255,.7);
  opacity: 0; transform: translateY(-5px) scale(.97);
  transition: opacity .18s, transform .22s cubic-bezier(.3,1.4,.5,1);
}
.uk-popover.show { opacity: 1; transform: none; }
.uk-popover[data-dir="top"] { transform-origin: bottom center; }
/* 팝오버 말꼬리(화살표) 제거 — 드롭다운은 꼬리 없이 깔끔하게 */
.uk-popover-arrow { display: none; }
.uk-popover-body { position: relative; border-radius: inherit; overflow: hidden; }

/* ----- 셀렉트 ----- */
.uk-select { position: relative; }
.uk-select-trigger {
  width: 100%; min-height: 47px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 11px;
  background: #fff; font-size: 14.5px; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.uk-select.open .uk-select-trigger { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.uk-select-label { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-weight: 600; }
.uk-select-label .ph { color: var(--text-faint); font-weight: 500; }
.uk-select-caret { color: var(--text-faint); transition: transform .22s cubic-bezier(.3,1.4,.5,1); display: flex; }
.uk-select.open .uk-select-caret { transform: rotate(180deg); }
.uk-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 7px; padding: 3px 5px 3px 9px;
  font-size: 12.5px; font-weight: 700;
  animation: uk-chip-in .2s cubic-bezier(.3,1.5,.5,1);
}
@keyframes uk-chip-in { from { transform: scale(.7); opacity: 0; } }
.uk-chip-x { border: none; background: transparent; color: inherit; opacity: .65; display: flex; padding: 2px; border-radius: 4px; }
.uk-chip-x:hover { opacity: 1; background: rgba(230,74,36,.14); }
.uk-select-list { min-width: 200px; }
.uk-select-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px; color: var(--text-faint);
  border-bottom: 1px solid rgba(23,32,46,.07);
}
.uk-select-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; }
.uk-select-opts { max-height: 244px; overflow-y: auto; padding: 6px; }
.uk-opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border: none; border-radius: 9px;
  background: transparent; font-size: 14px; font-weight: 600; text-align: left;
  color: var(--text); transition: background .1s;
}
.uk-opt:hover { background: rgba(255,92,53,.08); }
.uk-opt .tick { opacity: 0; transform: scale(.5); color: var(--brand); transition: all .18s cubic-bezier(.3,1.6,.5,1); display: flex; }
.uk-opt.sel { color: var(--brand-dark); background: var(--brand-soft); }
.uk-opt.sel .tick { opacity: 1; transform: scale(1); }
.uk-opt-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--text-faint); }

/* ----- 인풋 (아이콘/서픽스) & 검색 인풋 ----- */
.uk-input, .uk-search {
  display: flex; align-items: center; gap: 9px;
  padding: 0 13px; min-height: 47px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.uk-input:focus-within, .uk-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.uk-input .ic, .uk-search .ic { color: var(--text-faint); display: flex; font-weight: 700; }
.uk-input input, .uk-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 14.5px; padding: 12px 0; }
.uk-input .suffix { color: var(--text-faint); font-size: 13px; font-weight: 600; }
.uk-search-clear {
  border: none; background: rgba(23,32,46,.07); color: var(--text-sub);
  width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  animation: uk-chip-in .18s;
}
.uk-search-clear:hover { background: rgba(23,32,46,.14); }

/* ----- 라디오 ----- */
.uk-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.uk-radio {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.uk-radio:hover { border-color: #ffc7b3; }
.uk-radio input { display: none; }
.uk-radio .dot {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.uk-radio .dot i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad);
  transform: scale(0);
  transition: transform .25s cubic-bezier(.3,1.8,.5,1);
}
.uk-radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.uk-radio:has(input:checked) .dot { border-color: var(--brand); }
.uk-radio:has(input:checked) .dot i { transform: scale(1); }

/* ----- 탭 ----- */
.uk-tabs {
  position: relative; display: inline-flex; gap: 2px;
  background: rgba(23,32,46,.05);
  border-radius: 13px; padding: 4px;
}
.uk-tab {
  position: relative; z-index: 1;
  padding: 8px 18px; border: none; border-radius: 10px;
  background: transparent; font-size: 14px; font-weight: 700; color: var(--text-sub);
  transition: color .18s;
}
.uk-tab.active { color: var(--brand-dark); }
.uk-tabs-ink {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  background: #fff; border-radius: 10px;
  box-shadow: 0 3px 10px -2px rgba(23,32,46,.18);
  transition: transform .32s cubic-bezier(.25,1.3,.4,1), width .32s cubic-bezier(.25,1.3,.4,1);
}
.uk-tab-demo-body { padding: 13px 4px; font-size: 13.5px; color: var(--text-sub); }

/* ----- 캘린더 ----- */
.uk-cal { padding: 14px; width: 272px; user-select: none; }
.uk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.uk-cal-title { font-size: 14.5px; font-weight: 800; }
.uk-cal-nav {
  width: 30px; height: 30px; border-radius: 9px; border: none;
  background: rgba(23,32,46,.05); color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.uk-cal-nav:hover { background: var(--brand-soft); color: var(--brand-dark); }
.uk-cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-faint); margin-bottom: 4px; }
.uk-cal-wd .sun { color: var(--red); }
.uk-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
@keyframes uk-cal-slide-l { from { opacity: 0; transform: translateX(14px); } }
@keyframes uk-cal-slide-r { from { opacity: 0; transform: translateX(-14px); } }
.uk-cal-day {
  aspect-ratio: 1; border: none; border-radius: 9px;
  background: transparent; font-size: 13px; font-weight: 600; color: var(--text);
  transition: all .12s;
}
.uk-cal-day:hover { background: var(--brand-soft); transform: scale(1.08); }
.uk-cal-day.sun { color: var(--red); }
.uk-cal-day.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.uk-cal-day.sel { background: var(--grad); color: #fff; box-shadow: 0 4px 12px -3px rgba(255,92,53,.55); }
.uk-date-input { cursor: pointer; }

/* ----- 캐러셀 ----- */
.uk-carousel { position: relative; }
.uk-carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: 15px; scrollbar-width: none;
}
.uk-carousel-track::-webkit-scrollbar { display: none; }
.uk-carousel-track.drag { scroll-snap-type: none; cursor: grabbing; }
.uk-slide { flex: 0 0 100%; scroll-snap-align: center; }
.uk-slide-demo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 150px; font-size: 15px;
  background: linear-gradient(135deg, var(--navy), #2a3648);
  color: #fff; border-radius: 15px; margin: 0 4px;
}
.uk-carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.uk-carousel-dots button {
  width: 7px; height: 7px; border-radius: 99px; border: none;
  background: rgba(23,32,46,.18); padding: 0;
  transition: all .25s cubic-bezier(.3,1.3,.5,1);
}
.uk-carousel-dots button.on { width: 22px; background: var(--grad); }

/* ----- 쇼케이스 페이지 ----- */
.uk-show-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.uk-show-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; animation: fade-up .4s cubic-bezier(.2,.7,.3,1) both;
}
.uk-show-title { font-size: 14.5px; font-weight: 800; margin-bottom: 3px; }
.uk-show-note { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.uk-show-body { margin-top: 12px; }
.uk-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.uk-col > * { width: 100%; }
.uk-col .uk-btn { width: auto; }

/* ----- 3D 아바타 미리보기 ----- */
.avatar-preview.is-3d { overflow: hidden; touch-action: none; }
.avatar-preview.is-3d canvas { display: block; border-radius: 50%; }
.avatar-hint { font-size: 12px; color: var(--text-faint); margin: -4px 0 10px; }

/* ----- TTS 로딩 상태 ----- */
.tts-btn.loading { border-color: var(--brand); color: var(--brand-dark); opacity: .8; animation: tts-pulse 1s ease infinite; }

@media (max-width: 640px) {
  .uk-show-grid { grid-template-columns: 1fr; }
}

/* ---------- 아바타 스타일 선택 세그먼트 ---------- */
.style-seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 5px; margin-bottom: 14px;
}
.style-seg-btn {
  padding: 9px 6px; border: none; border-radius: 8px; background: transparent;
  font-size: 13.5px; font-weight: 700; color: var(--text-sub); transition: all .15s;
}
.style-seg-btn.sel { background: var(--card); color: var(--brand-dark); box-shadow: 0 2px 8px rgba(23,32,46,.10); }

/* 도트 아바타 — 픽셀 또렷하게 */
.avatar-pixel { image-rendering: pixelated; }

/* ---------- 차량 선택기 v2 (검색 원샷) ---------- */
.cp2 { display: flex; flex-direction: column; gap: 10px; }
.cp2-searchwrap { position: relative; }
.cp2-search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-sub); display: flex; pointer-events: none; z-index: 1; }
.cp2-searchwrap .cp2-search {
  width: 100%; padding: 13px 42px 13px 46px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.cp2-searchwrap .cp2-search::placeholder { color: var(--text-faint); }
.cp2-searchwrap .cp2-search:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 92, 53, .15);
}
.cp2-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: none; background: #eef1f5; color: var(--text-sub); border-radius: 50%; cursor: pointer;
  transition: background .12s, color .12s;
}
.cp2-search-clear:hover { background: var(--red-soft); color: var(--red); }
.cp2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp2-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--text-sub);
  transition: all .12s;
}
.cp2-chip b { color: var(--brand-dark); font-size: 11px; }
.cp2-chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.cp2-list { display: flex; flex-direction: column; padding: 4px; max-height: 280px; overflow-y: auto; }
.cp2-opt {
  text-align: left; padding: 10px 12px; border: none; background: none;
  border-radius: 8px; font-size: 14.5px; color: var(--text);
}
.cp2-opt b { color: var(--text-faint); font-weight: 600; margin-right: 2px; }
.cp2-opt:hover { background: var(--brand-soft); }
.cp2-opt.custom { color: var(--brand-dark); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 2px; }
.cp2-card { border: 1px solid #ffd4c7; background: var(--brand-soft); border-radius: 12px; padding: 13px 14px; }
.cp2-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp2-car-ic { color: var(--brand-dark); display: flex; }
.cp2-car-name { font-size: 15px; letter-spacing: -.3px; }
.cp2-year-badge { background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
/* 다시 검색 — 흐릿한 텍스트가 아니라 확실한 버튼으로 */
.cp2-clear {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--brand); background: #fff;
  color: var(--brand-dark); font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(255, 92, 53, .15);
  transition: all .13s;
}
.cp2-clear:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
.cp2-years { display: flex; gap: 5px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: thin; }
.cp2-year {
  flex-shrink: 0; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); background: #fff; color: var(--text-sub);
}
.cp2-year.sel { background: var(--navy); border-color: var(--navy); color: #fff; }
/* 높이 완전 고정 — 검색/결과/선택 전환에도 카드 크기가 절대 안 변함 */
/* 고정 높이 없이 내용만큼만 — 선택 전/후 모두 빈 공간 최소화 */
.cp2-fixed { min-width: 0; display: flex; flex-direction: column; }
.cp2-fixed .cp2-card { min-width: 0; display: flex; flex-direction: column; }
.cp2-card-top { min-width: 0; }
.cp2-car-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cp2-detail-field, .cp2-year-field { margin-top: 14px; }
.cp2-year-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-sub); margin-bottom: 6px; }
.cp2-year-label span { color: var(--text-faint); font-weight: 600; }
.cp2-detail {
  width: 100%; padding: 11px 12px;
  border: 1px solid #ffd4c7; border-radius: 10px;
  background: #fff; color: var(--text);
  font-size: 14px; font-weight: 650;
}
.cp2-detail:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.12); }
.cp2-year-mount .uk-select { max-width: 200px; }
.cp2-inline { margin-top: 8px; max-height: 264px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; }
.cp2-inline-head { font-size: 11.5px; font-weight: 700; color: var(--text-faint); padding: 2px 6px 6px; letter-spacing: .2px; }
.cp2-inline .cp2-opt {
  display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 9px 10px; border: none; background: none;
  border-radius: 9px; color: var(--text); flex-shrink: 0; cursor: pointer;
  transition: background .1s;
}
.cp2-opt-brand {
  flex-shrink: 0; min-width: 78px;
  font-size: 11.5px; font-weight: 700; color: var(--text-sub);
  background: #f1f3f6; border-radius: 6px; padding: 3px 8px; text-align: center;
}
.cp2-opt-model { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; }
.cp2-opt mark { background: transparent; color: var(--brand); font-weight: 800; padding: 0; }
.cp2-inline .cp2-opt:hover,
.cp2-inline .cp2-opt.active { background: var(--brand-soft); }
.cp2-inline .cp2-opt.active .cp2-opt-brand { background: #ffe1d6; color: var(--brand-dark); }
.cp2-noresult { padding: 22px 12px; color: var(--text-faint); font-size: 13px; text-align: center; line-height: 1.6; }

/* ---------- Ready Player Me (3D 스튜디오) ---------- */
.avatar-rpm { border-radius: 50%; object-fit: cover; }
.rpm-empty {
  height: 100%; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-faint); font-size: 13px; text-align: center; line-height: 1.5;
}
.rpm-empty svg { color: var(--brand); }
.rpm-err { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-faint); font-size: 13px; }
.rpm-frame-wrap { width: min(760px, 88vw); height: min(640px, 74vh); }
.rpm-frame { width: 100%; height: 100%; border: none; border-radius: 12px; background: #f2f2f7; }
/* RPM 모달은 넓게 */
.uk-modal:has(.rpm-frame-wrap) { width: min(820px, 94vw); }

/* ---------- 내 차량 카드 + 사진 피드 ---------- */
.mycar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn.car-edit-btn { padding: 6px 14px; font-size: 13px; }
.mycar-name-row { margin: 6px 0 16px; }
.mycar-name {
  display: inline-flex; align-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 800; font-size: 15px; letter-spacing: -.3px;
  padding: 7px 14px; border-radius: 10px;
}
.carfeed-label { font-size: 12.5px; font-weight: 700; color: var(--text-sub); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.carfeed { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.carfeed.uploading { opacity: .5; pointer-events: none; }
.carfeed-loading { grid-column: 1/-1; padding: 24px; text-align: center; color: var(--text-faint); font-size: 13px; }
.carfeed-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.carfeed-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.carfeed-del {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px; background: rgba(23,32,46,.62); color: #fff;
  opacity: 0; transition: opacity .12s;
}
.carfeed-item:hover .carfeed-del { opacity: 1; }
.carfeed-del:hover { background: var(--red); }
.carfeed-add {
  aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text-faint); font-size: 12px; font-weight: 700; line-height: 1.5;
  cursor: pointer; transition: all .12s;
}
.carfeed-add:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.carfeed-add span { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* 글쓰기 사진 미리보기 */
/* 커스텀 파일 드롭존 (기본 <input type=file> 대체) */
.field label.filedrop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 22px 16px; margin: 0; border: 1.5px dashed #d4dae2; border-radius: 12px;
  background: #fbfcfd; cursor: pointer; text-align: center; font-weight: 400;
  transition: border-color .15s, background .15s;
}
.filedrop:hover { border-color: #ffc0a8; background: var(--brand-soft); }
.filedrop.drag { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(255,92,53,.12); }
.filedrop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filedrop-ic { color: var(--brand); display: flex; margin-bottom: 1px; }
.filedrop-main { font-size: 13.5px; color: var(--text-sub); }
.filedrop-main b { color: var(--brand-dark); font-weight: 700; }
.filedrop-sub { font-size: 11.5px; color: var(--text-faint); }
.img-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin-top: 10px; }
.img-preview:empty { display: none; }
.tier-preview {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.tier-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-sub);
}
.tier-preview-head b { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.tier-preview img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #17202e; }
.tier-preview-rm {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; border-radius: 7px; padding: 5px 8px;
  background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 800;
}
.tier-preview-rm:hover { background: var(--red); color: #fff; }
.img-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-rm {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: rgba(23,32,46,.65); color: #fff;
}
.img-thumb-rm:hover { background: var(--red); }

/* ---------- 글/댓글 인라인 수정 + 부품 상태 선택 ---------- */
.comment-acts { margin-left: auto; display: inline-flex; gap: 2px; }
.comment-acts button {
  border: none; background: none; color: var(--text-faint);
  font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px;
}
.comment-acts button:hover { color: var(--brand-dark); background: var(--brand-soft); }
.edit-form { display: flex; flex-direction: column; gap: 8px; }
.edit-form input, .edit-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.edit-form textarea { min-height: 110px; resize: vertical; }
.edit-form input:focus, .edit-form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.edit-form-row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.cond-select { display: flex; gap: 8px; }
.cond-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cond-opt span {
  display: inline-block; padding: 8px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 700;
  border: 1.5px solid var(--line); background: #fff; color: var(--text-sub); cursor: pointer; transition: all .12s;
}
.cond-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 판단 마감 ---------- */
.outcome-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 20px; background: var(--bg);
}
.outcome-q { font-size: 13.5px; font-weight: 700; color: var(--text-sub); flex: 1; min-width: 200px; }
.outcome-btns { display: flex; gap: 8px; }
.outcome-yes { border-color: var(--green); color: var(--green); font-weight: 800; }
.outcome-yes:hover { background: var(--green-soft); }
.outcome-no { border-color: var(--red); color: var(--red); font-weight: 800; }
.outcome-no:hover { background: var(--red-soft); }
.outcome-box.done { border-style: solid; }
.outcome-box.done.proceeded { border-color: var(--green); background: var(--green-soft); }
.outcome-box.done.passed { border-color: #d5d9e0; background: #f1f3f6; }
.outcome-badge { font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.outcome-note { font-size: 12.5px; color: var(--text-sub); flex: 1; }
.outcome-undo { border: none; background: none; color: var(--text-faint); font-size: 12px; font-weight: 600; text-decoration: underline; }
.badge.outcome-proceeded { background: var(--green-soft); color: var(--green); }
.badge.outcome-passed { background: #f1f3f6; color: var(--text-faint); }

/* ---------- 글쓰기 임시저장 배너 ---------- */
.draft-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff9e8; border: 1px solid #f2dfa8; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; color: #7a5c14;
}
.draft-bar b { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-acts { margin-left: auto; display: flex; gap: 6px; }
.draft-acts button {
  border: 1px solid #e8d391; background: #fff; border-radius: 8px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 700; color: #7a5c14;
}
.draft-acts #draft-restore { background: #f5c542; border-color: #f5c542; color: #4a3800; }

/* ---------- 글쓰기 보조 도구 ---------- */
.make-entry {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.make-entry-head { min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.make-entry-head b { font-size: 13.5px; font-weight: 850; color: var(--text); }
.make-entry-head span { font-size: 12px; color: var(--text-faint); }
.make-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.make-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--text-sub);
  font-size: 13px; font-weight: 750; text-decoration: none;
  white-space: nowrap; /* "티어 만들기"가 세로로 쪼개지지 않게 */
  transition: background .12s, border-color .12s, color .12s;
}
.make-tool.active { background: #fff; border-color: var(--line); color: var(--text-sub); }
.make-tool:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.make-tool:disabled { background: var(--bg); opacity: .55; cursor: not-allowed; }

/* ---------- 티어 만들기 ---------- */
.tl { max-width: 940px; margin: 0 auto; }
.tl-head h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 7px; letter-spacing: -.4px; }
.tl-head h2 .i { color: var(--brand); }
.tl-sub { font-size: 13.5px; color: var(--text-sub); margin: 4px 0 16px; }
.tl-title {
  width: 100%; padding: 13px 16px; font-size: 17px; font-weight: 800;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 18px;
  transition: border-color .15s, box-shadow .15s;
}
.tl-title:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.15); }

.tl-tiers { display: flex; flex-direction: column; gap: 4px; }
.tl-row { display: flex; align-items: flex-start; gap: 4px; }
.tl-label {
  flex-shrink: 0; width: 100px; height: 100px; border-radius: 6px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.tl-label-input {
  width: 100%; height: 100%; min-height: 0; text-align: center;
  background: transparent; border: none; outline: none;
  font-size: 18px; font-weight: 900; letter-spacing: -.5px;
}
.tl-label-input::placeholder { color: rgba(255,255,255,.7); }
.tl-drop {
  flex: 1; min-height: 100px; min-width: 0; box-sizing: border-box;
  display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start;
  padding: 0; border-radius: 6px;
  background: var(--bg); border: 1.5px dashed transparent;
  transition: background .12s, border-color .12s;
}
.tl-drop.tl-zone-over { background: var(--brand-soft); border-color: var(--brand); }
.tl-ctl { flex-shrink: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.tl-ctl-btn {
  width: 26px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text-sub); cursor: pointer;
}
.tl-ctl-btn:hover { border-color: var(--brand); color: var(--brand); }
.tl-ctl-btn:disabled { opacity: .35; cursor: default; }
.tl-ctl-btn.tl-ctl-del:hover { border-color: var(--red); color: var(--red); }
.tl-up { display: flex; transform: rotate(180deg); }
.tl-ctl-btn[data-color] { border: 1px solid rgba(0,0,0,.1); }

.tl-add-tier {
  margin: 8px 0 4px; padding: 9px 16px; width: 100%;
  border: 1.5px dashed var(--line); border-radius: 10px; background: var(--card);
  font-size: 13.5px; font-weight: 700; color: var(--text-sub); cursor: pointer; transition: all .12s;
}
.tl-add-tier:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.tl-chip {
  position: relative;
  width: 100px; height: 100px; flex: 0 0 100px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px 8px 10px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--text);
  text-align: center;
  cursor: grab; user-select: none; box-shadow: 0 1px 2px rgba(23,32,46,.06);
}
.tl-chip:active { cursor: grabbing; }
.tl-chip.tl-dragging { opacity: .35; }
/* 정사각 타일: 브랜드+모델 + 세대·트림·연식 서브라인 */
.tl-chip-txt { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tl-chip-txt b { font-weight: 900; line-height: 1.12; overflow-wrap: anywhere; }
.tl-chip-txt i { font-style: normal; font-size: 11px; line-height: 1.15; font-weight: 700; color: var(--text-faint); overflow-wrap: anywhere; }

/* 추가 진행 바 — 세대/트림/연식 고르고 담기 */
.tl-pend {
  margin: 8px 0 10px; padding: 13px 14px;
  border: 1.5px solid var(--brand); border-radius: 12px; background: var(--brand-soft);
  display: flex; flex-direction: column; gap: 9px;
}
.tl-pend-top { display: flex; align-items: center; justify-content: space-between; }
.tl-pend-car { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--brand-dark); }
.tl-pend-car b { color: var(--text); letter-spacing: -.3px; }
.tl-pend-cancel {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: rgba(0,0,0,.06); color: var(--text-sub); cursor: pointer;
}
.tl-pend-cancel:hover { background: var(--red-soft); color: var(--red); }
.tl-opt-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; }
.tl-opt-name { flex-shrink: 0; width: 32px; font-size: 12px; font-weight: 800; color: var(--text-sub); }
.tl-opt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tl-pend-step .tl-opt-name { line-height: 34px; }
.tl-opt-chip {
  padding: 9px 15px; border-radius: 11px; border: 1.5px solid #ffd0bf; background: #fff;
  font-size: 14px; font-weight: 800; color: var(--text); cursor: pointer; transition: all .12s;
  line-height: 1.1;
}
.tl-opt-chip i { font-style: normal; font-weight: 700; font-size: .82em; opacity: .55; margin-left: 4px; }
.tl-opt-chip.sel i { opacity: .8; }
.tl-opt-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.tl-opt-chip.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.tl-opt-skip { border-style: dashed; color: var(--text-faint); }
/* 순차 스텝: 고른 값 배지 + 단계 표시 */
.tl-pend-badge {
  display: inline-flex; align-items: center;
  margin-left: 2px; padding: 2px 8px; border-radius: 6px;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800;
}
.tl-pend-step { display: flex; align-items: flex-start; gap: 10px; }
.tl-pend-step .tl-opt-name { padding-top: 6px; width: auto; }
.tl-pend-step .tl-opt-name em { font-style: normal; color: var(--text-faint); font-weight: 600; margin-left: 2px; }
.tl-year-row { display: flex; align-items: center; gap: 8px; flex: 1; }
.tl-year-row .tl-year-mount { flex: 0 0 170px; }
.tl-year-row .tl-pend-add { margin-left: auto; }
.tl-year-mount { flex: 1; max-width: 180px; }
.tl-year-mount .uk-select-trigger { min-height: 38px; padding: 5px 11px; font-size: 13.5px; }
.tl-pend-add { align-self: flex-end; padding: 8px 18px; }

/* 메인 차량 선택기: 세부 모델 제안 칩 (세대/트림) */
.cp2-detail-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; }
.cp2-dsug {
  padding: 9px 15px; border-radius: 11px; border: 1.5px solid #ffd0bf; background: #fff;
  font-size: 14px; font-weight: 800; color: var(--text); cursor: pointer; transition: all .12s;
  line-height: 1.1;
}
.cp2-dsug:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
/* 연도 범위 — 이탤릭 제거, 살짝 작게·연하게 (선택 시엔 흰색 톤) */
.cp2-dsug i { font-style: normal; font-weight: 700; font-size: .82em; opacity: .55; margin-left: 4px; }
.cp2-dsug.sel i { opacity: .8; }
.cp2-dsug.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.cp2-detail-field .cp2-detail-sug + .cp2-detail-sug { margin-top: 6px; }
.cp2-dsug-name { flex-shrink: 0; width: 34px; font-size: 12.5px; font-weight: 800; color: var(--text-sub); align-self: center; }
.cp2-dsug-skip { border-style: dashed; color: var(--text-faint); }
.cp2-detail-badge {
  display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 800;
}
.cp2-detail-none { font-size: 12.5px; color: var(--text-faint); align-self: center; }
.tl-chip-x {
  position: absolute; top: 4px; right: 4px;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(238,241,245,.92); color: var(--text-faint); cursor: pointer;
}
.tl-chip-x:hover { background: var(--red-soft); color: var(--red); }
.tl-ghost {
  position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
  transform: rotate(-2deg) scale(1.05); box-shadow: 0 12px 28px -8px rgba(23,32,46,.4);
  opacity: .95;
}

.tl-pool-wrap { margin-top: 22px; }
.tl-pool-head { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.tl-pool-head span { font-size: 12px; font-weight: 500; color: var(--text-faint); margin-left: 6px; }
.tl-adder { position: relative; margin-bottom: 10px; z-index: 20; }
.tl-add-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; display: flex; }
.tl-add-input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.tl-add-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.15); }
.tl-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  display: flex; flex-direction: column; gap: 0;
  max-height: 252px; overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 36px -22px rgba(23,32,46,.45);
}
.tl-suggest:empty { display: none; }
.tl-sug {
  width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 9px; border: 0; background: transparent;
  font-size: 13.5px; font-weight: 650; color: var(--text-sub); cursor: pointer; transition: all .12s;
}
.tl-sug:hover { color: var(--brand-dark); background: var(--brand-soft); }
.tl-sug b { color: var(--text); }
.tl-sug-custom { color: var(--brand); border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 2px; }
.tl-pool { background: #f1f3f6; min-height: 100px; }
.tl-pool-empty { color: var(--text-faint); font-size: 13px; align-self: center; }

.tl-actions { display: flex; gap: 8px; margin-top: 22px; justify-content: flex-end; }

@media (max-width: 560px) {
  .make-entry { align-items: stretch; flex-direction: column; }
  .make-tools { flex-direction: column; }
  .make-tool { width: 100%; }
  .tl-label { width: 78px; height: 78px; }
  .tl-label-input { font-size: 15px; min-height: 0; }
  .tl-drop { min-height: 78px; padding: 0; }
  .tl-chip { width: 78px; height: 78px; flex-basis: 78px; font-size: 11.5px; padding: 10px 6px 8px; }
  .tl-chip-txt i { font-size: 9.8px; }
}

/* ---------- NEW 뱃지 & 주간 인기글 ---------- */
.badge.badge-new { background: #12b76a; color: #fff; font-size: 10px; letter-spacing: .5px; padding: 3px 7px; }
.hot-week {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px;
}
.hot-week-head { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 10px; }
.hot-week-head .i { color: var(--brand); }
.hot-week-head span { font-size: 11.5px; color: var(--text-faint); margin-left: 2px; }
.hot-week-list { display: flex; flex-direction: column; }
.hot-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px;
  min-width: 0; transition: background .12s;
}
.hot-item:hover { background: var(--brand-soft); }
.hot-rank {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: #eef1f5; color: var(--text-sub); font-size: 11.5px; font-weight: 800;
}
.hot-rank.top { background: var(--brand); color: #fff; }
.hot-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-views { flex-shrink: 0; font-size: 12px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 3px; }

/* ---------- 사진 썸네일 (편집/재정렬) ---------- */
.filedrop-actions { margin-top: 8px; display: flex; gap: 8px; }
/* 카메라 촬영은 모바일(터치) 전용 — 마우스 기반 PC에선 숨김 */
@media (hover: hover) and (pointer: fine) { .filedrop-actions { display: none; } }
.filedrop-cam { font-size: 13px; padding: 8px 14px; }
.img-thumb { cursor: grab; user-select: none; }
.img-thumb-n {
  position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 6px;
  background: rgba(23,32,46,.75); color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.img-thumb-dragging { opacity: .35; }
.img-thumb-over { outline: 2.5px solid var(--brand); outline-offset: 1px; }
.img-thumb-ghost {
  position: fixed; z-index: 400; pointer-events: none; border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 28px -8px rgba(23,32,46,.45); transform: rotate(-3deg) scale(1.05); opacity: .95;
}
.img-thumb-ghost img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 사진 편집기 ---------- */
.ie-overlay {
  position: fixed; inset: 0; z-index: 500; background: rgba(15, 20, 28, .93);
  display: flex; flex-direction: column; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ie-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; color: #fff;
}
.ie-top b { font-size: 15px; }
.ie-top-actions { display: flex; gap: 8px; }
.ie-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.ie-btn:hover { background: rgba(255,255,255,.16); }
.ie-btn.ie-primary { background: var(--brand); border-color: var(--brand); }
.ie-btn.ie-primary:hover { background: var(--brand-dark); }
.ie-btn [data-undo] .i { transform: rotate(90deg); }
.ie-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px; position: relative; }
.ie-canvas { max-width: 96%; max-height: 100%; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.ie-crop-box {
  position: absolute; border: 2px dashed #fff; background: rgba(255,255,255,.12);
  pointer-events: none; border-radius: 4px;
}
.ie-tools {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}
.ie-tool {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.ie-tool.sel { background: var(--brand); border-color: var(--brand); }
.ie-colors { display: inline-flex; gap: 6px; align-items: center; }
.ie-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); cursor: pointer; }
.ie-color.sel { border-color: #fff; transform: scale(1.15); }

/* ---------- 대댓글 (유튜브식 스레드) ---------- */
.reply-btn {
  border: none; background: none; padding: 2px 0; margin-top: 2px;
  font-size: 12px; font-weight: 700; color: var(--text-faint); cursor: pointer;
}
.reply-btn:hover { color: var(--brand); }
.replies-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: none; padding: 4px 0 4px 38px;
  font-size: 12.5px; font-weight: 800; color: #3563e9; cursor: pointer;
}
.replies-toggle .rt-caret { display: flex; transition: transform .18s; }
.replies-toggle.open .rt-caret { transform: rotate(180deg); }
.replies { margin-left: 34px; padding-left: 12px; border-left: 2px solid var(--line); }
.comment.is-reply { padding: 8px 0; }
.reply-form { margin: 6px 0 10px 46px; }
.reply-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; resize: vertical;
}
.reply-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.14); }
.reply-form-row { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.reply-form-row .btn { padding: 6px 13px; font-size: 12.5px; }

/* ---------- 자유게시판 커스텀 투표 ---------- */
.poll-maker .poll-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.poll-maker .poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-maker .poll-add { align-self: flex-start; padding: 6px 12px; font-size: 12.5px; }
.poll-maker .poll-toggle { padding: 8px 14px; font-size: 13px; }
.poll-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 18px 0;
}
.poll-box h3 { font-size: 15.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.poll-box h3 .i { color: var(--brand); }
.poll-opt-row {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 11px 14px; margin-bottom: 6px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer; overflow: hidden;
  transition: border-color .13s;
}
.poll-opt-row:hover { border-color: var(--brand); }
.poll-opt-row.sel { border-color: var(--brand); }
.poll-opt-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--brand-soft); z-index: 0; transition: width .3s ease;
}
.poll-opt-row.sel .poll-opt-bar { background: #ffd9cb; }
.poll-opt-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; }
.poll-opt-label .i { color: var(--brand); }
.poll-opt-pct { position: relative; z-index: 1; font-size: 13px; color: var(--text-sub); font-weight: 800; }
.poll-total { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ---------- 표 만들기 ---------- */
.tb { max-width: 860px; margin: 0 auto; }
.tb-grid-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tb-grid { width: 100%; border-collapse: separate; border-spacing: 6px; }
.tb-grid td { padding: 0; }
.tb-grid td input {
  width: 100%; min-width: 90px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 14px; font-weight: 600; text-align: center;
  transition: border-color .13s, box-shadow .13s;
}
.tb-grid td input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.13); }
.tb-grid td input.tb-head { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 800; }
.tb-grid td input.tb-head::placeholder { color: rgba(255,255,255,.7); }
.tb-rowctl { width: 30px; }
.tb-rowctl button {
  width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--text-faint); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tb-rowctl button:hover { border-color: var(--red); color: var(--red); }
.tb-ctls { display: flex; gap: 8px; margin-top: 10px; }
.tb-ctls .btn { font-size: 13px; padding: 8px 14px; }

/* ---------- 직접 그리는 픽셀 캐릭터 에디터 ---------- */
.px-builder { display: flex; gap: 22px; align-items: flex-start; }
.px-side { flex-shrink: 0; width: 190px; display: flex; flex-direction: column; gap: 8px; }
.px-main { flex: 1; min-width: 0; }
.px-tools { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.px-tool {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 700; color: var(--text-sub); cursor: pointer;
}
.px-tool.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
#px-canvas {
  width: 100%; max-width: 480px; aspect-ratio: 1; display: block;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: crosshair;
  touch-action: none;
}
.px-pal { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.px-swatch {
  width: 30px; height: 30px; border-radius: 9px; border: 2px solid rgba(23,32,46,.12);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .12s, border-color .12s;
}
.px-swatch:hover { transform: scale(1.12); }
.px-swatch.sel { border-color: var(--brand); transform: scale(1.12); box-shadow: 0 0 0 3px rgba(255,92,53,.18); }
.px-erase { background: repeating-conic-gradient(#e8ebf0 0 25%, #fff 0 50%) 50%/12px 12px; color: var(--text-sub); }
.px-bgrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.px-bglabel { font-size: 12px; font-weight: 800; color: var(--text-sub); margin-right: 2px; }
.px-bg { width: 24px; height: 24px; border-radius: 50%; }
@media (max-width: 680px) {
  .px-builder { flex-direction: column; }
  .px-side { width: 100%; }
  .px-side .avatar-preview { margin: 0 auto; }
}

/* ---------- 미니 프로필 팝오버 ---------- */
.meta-user.clk, .comment-who.clk { cursor: pointer; border-radius: 6px; padding: 1px 3px; margin: -1px -3px; transition: background .12s; }
.meta-user.clk:hover, .comment-who.clk:hover { background: var(--brand-soft); }
.comment-who.clk { display: inline-flex; align-items: center; gap: 7px; }
.mini-profile { padding: 17px 17px 16px; }
.mini-top { display: flex; align-items: center; gap: 13px; }
.mini-info { min-width: 0; }
.mini-nick { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.mini-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 800;
  background: var(--brand); color: #fff; padding: 2px 6px; border-radius: 6px;
}
.mini-car { font-size: 12.5px; color: var(--text-sub); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.mini-car.muted { color: var(--text-faint); font-weight: 500; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 15px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-sub); }
.mini-stats b { color: var(--text); font-weight: 800; }
.mini-stats .mini-joined { color: var(--text-faint); }
.mini-chat { margin-top: 15px; }

/* 프로필 한마디 입력 */
.px-bio-field { display: flex; flex-direction: column; gap: 5px; }
.px-bio-field label { font-size: 12.5px; font-weight: 800; color: var(--text-sub); }
.px-bio-field input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; background: #fff; transition: border-color .13s, box-shadow .13s;
}
.px-bio-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,92,53,.13); }
/* 미니 팝오버 한마디 */
.mini-bio {
  margin-top: 13px; padding: 9px 12px 9px 14px; border-radius: 9px; background: var(--bg);
  font-size: 12.5px; color: var(--text-sub); line-height: 1.45; font-style: italic;
}
.mini-bio::before { content: "\201C"; color: var(--brand); font-weight: 800; font-style: normal; margin-right: 1px; }
.mini-bio::after { content: "\201D"; color: var(--brand); font-weight: 800; font-style: normal; margin-left: 1px; }

/* ---------- 관리자 대시보드 ---------- */
.adm { max-width: 960px; margin: 0 auto; padding: 4px 0 40px; }
.adm-h { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; margin: 8px 0 18px; }
.adm-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.adm-kpi { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.adm-kpi-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.adm-kpi-v { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.adm-kpi-l { font-size: 12.5px; color: var(--text-sub); margin-top: 2px; }
.adm-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 16px; margin-bottom: 16px; }
.adm-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.adm-card-h h2 { font-size: 15px; font-weight: 800; }
.adm-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); }
.adm-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.adm-legend .lg-uv { background: var(--brand); }
.adm-legend .lg-pv { background: #ffcbb8; }
/* 막대 차트 */
.adm-chart { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding-top: 6px; }
.adm-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; min-width: 0; }
.adm-stack { position: relative; width: 100%; max-width: 20px; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.adm-stack .adm-pv, .adm-stack .adm-uv { position: absolute; bottom: 0; width: 100%; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.adm-stack .adm-pv { background: #ffcbb8; }
.adm-stack .adm-uv { background: var(--brand); }
.adm-bar > em { font-size: 9.5px; color: var(--text-faint); font-style: normal; }
.adm-bar.today > em { color: var(--brand); font-weight: 800; }
.adm-bar:hover .adm-uv { filter: brightness(.94); }
/* 게시판별 */
.adm-boards { display: flex; flex-direction: column; gap: 11px; }
.adm-brow { display: grid; grid-template-columns: 108px 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.adm-blabel { color: var(--text-sub); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-btrack { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.adm-bfill { display: block; height: 100%; background: var(--brand); border-radius: 6px; min-width: 3px; }
.adm-brow b { text-align: right; font-weight: 800; }
@media (max-width: 640px) {
  .adm-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .adm-kpi-v { font-size: 20px; }
  .adm-brow { grid-template-columns: 92px 1fr 40px; }
}
