/* ==========================================================================
   띵잡 디자인 시스템 — 깔끔한 흰 배경 + 포인트 1색(인디고)
   빌드 도구 없이 바로 쓰는 순수 CSS. 색은 모두 :root 토큰으로 관리.
   ========================================================================== */

:root {
  /* 직거래 경고(추가5 6번): 노랑 계열 */
  --guard-bg: #FFF7E6; --guard-line: #F5C46B; --guard-ink: #8A5A00;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: #EEF2FF;
  --primary-ink: #3730A3;
  --ok: #10B981;
  --ok-soft: #ECFDF5;
  --ok-ink: #047857;
  --warn: #F59E0B;
  --warn-soft: #FFFBEB;
  --warn-ink: #B45309;
  --danger: #EF4444;
  --danger-soft: #FEF2F2;
  --danger-ink: #B91C1C;
  --info: #0EA5E9;
  --info-soft: #F0F9FF;
  --info-ink: #0369A1;
  --text: #111827;
  --text-2: #374151;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --bg: #FFFFFF;
  --bg-soft: #F9FAFB;
  --bg-sunken: #F3F4F6;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --card: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow: 0 1px 3px rgba(17, 24, 39, .05), 0 4px 12px rgba(17, 24, 39, .04);
  --shadow-lg: 0 10px 30px rgba(17, 24, 39, .10);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --header-h: 64px;
  --tabbar-h: 64px;
  --maxw: 1200px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --guard-bg: #2E2208; --guard-line: #8A6418; --guard-ink: #F8D58A;
    --primary: #818CF8;
    --primary-hover: #A5B4FC;
    --primary-soft: #1E1B4B;
    --primary-ink: #C7D2FE;
    --ok-soft: #052E22; --ok-ink: #6EE7B7;
    --warn-soft: #3A2A05; --warn-ink: #FCD34D;
    --danger-soft: #3B0D0D; --danger-ink: #FCA5A5;
    --info-soft: #082F49; --info-ink: #7DD3FC;
    --text: #F3F4F6;
    --text-2: #D1D5DB;
    --muted: #9CA3AF;
    --faint: #6B7280;
    --bg: #0B0F19;
    --bg-soft: #111827;
    --bg-sunken: #1A2233;
    --line: #243042;
    --line-strong: #334155;
    --card: #121A2A;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --guard-bg: #2E2208; --guard-line: #8A6418; --guard-ink: #F8D58A;
  --primary: #818CF8; --primary-hover: #A5B4FC; --primary-soft: #1E1B4B; --primary-ink: #C7D2FE;
  --ok-soft: #052E22; --ok-ink: #6EE7B7; --warn-soft: #3A2A05; --warn-ink: #FCD34D;
  --danger-soft: #3B0D0D; --danger-ink: #FCA5A5; --info-soft: #082F49; --info-ink: #7DD3FC;
  --text: #F3F4F6; --text-2: #D1D5DB; --muted: #9CA3AF; --faint: #6B7280;
  --bg: #0B0F19; --bg-soft: #111827; --bg-sunken: #1A2233; --line: #243042; --line-strong: #334155;
  --card: #121A2A; --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ── 기본 ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
p { margin: 0 0 .75em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
small, .small { font-size: .86rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.ic-sm { width: 16px; height: 16px; flex-shrink: 0; }
.ic-lg { width: 28px; height: 28px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; color: #fff; }

/* ── 레이아웃 ── */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 760px; }
.container-md { max-width: 960px; }
.page { padding: 28px 0 64px; min-height: 60vh; }
.section { padding: 40px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-side { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-ok { color: var(--ok-ink); }
.text-warn { color: var(--warn-ink); }
.text-danger { color: var(--danger-ink); }
.text-primary { color: var(--primary); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hide-mobile { }
.only-mobile { display: none; }

/* ── 헤더 ── */
.header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header .container { height: 100%; display: flex; align-items: center; gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 850; font-size: 1.28rem; letter-spacing: -.04em; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .95rem; font-weight: 900; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.active { background: var(--bg-sunken); color: var(--text); }
.header-search { flex: 1; max-width: 380px; position: relative; }
.header-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font: inherit; font-size: .93rem; }
.header-search .ic { position: absolute; left: 13px; top: 10px; color: var(--faint); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--bg-sunken); color: var(--text); }
.dot { position: absolute; top: 8px; right: 8px; min-width: 8px; height: 8px; border-radius: 99px; background: var(--danger); border: 2px solid var(--bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-xl { width: 88px; height: 88px; font-size: 2rem; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px; color: var(--text-2); font: inherit; font-size: .94rem; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-sunken); color: var(--text); }
.dropdown-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ── 모바일 하단 탭(추가1 B-6) ── */
.tabbar { display: none; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font: inherit; font-weight: 650; font-size: .97rem;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--bg-sunken); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 80%, var(--primary) 20%); color: var(--primary-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-danger { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger-ink); }
.btn-sm { height: 36px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1.03rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ── 뱃지·칩 ── */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: .78rem; font-weight: 700; background: var(--bg-sunken); color: var(--text-2); white-space: nowrap; }
.badge .ic-sm { width: 13px; height: 13px; }
.badge-ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-danger { background: var(--danger-soft); color: var(--danger-ink); }
.badge-info { background: var(--info-soft); color: var(--info-ink); }
.badge-primary { background: var(--primary-soft); color: var(--primary-ink); }
.badge-muted { background: var(--bg-sunken); color: var(--muted); }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.badge-demo { background: #FEF3C7; color: #92400E; border: 1px dashed #F59E0B; }
:root[data-theme="dark"] .badge-demo { background: #3A2A05; color: #FCD34D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-demo { background: #3A2A05; color: #FCD34D; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }

/* ── 카드 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-pad-lg { padding: 28px; }
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card-title { font-weight: 700; font-size: 1.02rem; }

/* 공고 카드(위시켓식: 예산·기간·지원자 수·D-day) */
.p-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; height: 100%; position: relative; }
.p-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p-card h3 { font-size: 1.03rem; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.p-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: .88rem; }
.p-card-meta div { display: flex; flex-direction: column; }
.p-card-meta dt { color: var(--muted); font-size: .78rem; }
.p-card-meta dd { margin: 0; font-weight: 700; color: var(--text); }
.p-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }
.dday { font-weight: 800; color: var(--danger-ink); white-space: nowrap; flex-shrink: 0; }
.p-card-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dday.calm { color: var(--text-2); }
.p-card.is-demo, .s-card.is-demo { background: repeating-linear-gradient(135deg, var(--card) 0 14px, color-mix(in srgb, var(--warn-soft) 55%, var(--card)) 14px 15px); }

/* 서비스 카드(크몽식: 썸네일·가격·평점) */
.s-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.thumb { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; color: #fff; display: flex; align-items: flex-end; padding: 14px; }
.thumb::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.35), transparent 45%), radial-gradient(circle at 10% 100%, rgba(0,0,0,.18), transparent 55%); }
.thumb-icon { position: absolute; right: 14px; top: 14px; width: 54px; height: 54px; opacity: .92; z-index: 1; }
.thumb-icon svg { width: 100%; height: 100%; stroke-width: 1.4; }
.thumb-title { position: relative; z-index: 1; font-weight: 800; font-size: 1.05rem; line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,.18); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 78%; }
.thumb-badges { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 6px; }
.s-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.s-card-body .seller { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.s-card-body h3 { font-size: .98rem; font-weight: 650; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 800; font-size: 1.08rem; color: var(--text); }
.price small { font-weight: 600; color: var(--muted); font-size: .8rem; }
.rating { display: inline-flex; align-items: center; gap: 3px; font-size: .86rem; font-weight: 700; }
.rating .ic-sm { color: #F59E0B; fill: #F59E0B; width: 14px; height: 14px; }
.rating span { color: var(--muted); font-weight: 500; }
.fav-btn { position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.92); color: #374151; display: grid; place-items: center; border: 0; cursor: pointer; }
.fav-btn.on .ic { fill: #EF4444; color: #EF4444; }

/* 전문가 카드 */
.e-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.e-card-head { display: flex; gap: 12px; align-items: center; }
.e-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; font-size: .8rem; color: var(--muted); background: var(--bg-soft); border-radius: 10px; padding: 8px 4px; }
.e-card .stats b { display: block; color: var(--text); font-size: .95rem; }

/* 카테고리 아이콘 그리드 */
.cat-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--radius); color: var(--text-2); font-size: .88rem; font-weight: 650; text-align: center; }
.cat-item:hover { background: var(--bg-soft); color: var(--text); }
.cat-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, var(--card)); color: var(--c); }
.cat-icon .ic { width: 26px; height: 26px; }

/* ── 히어로·검색 ── */
.hero { padding: 56px 0 36px; background: radial-gradient(1200px 400px at 50% -120px, var(--primary-soft), transparent 70%); }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); font-weight: 850; letter-spacing: -.04em; text-align: center; }
.hero p.lead { text-align: center; color: var(--muted); font-size: 1.05rem; margin: 12px auto 26px; max-width: 560px; }
.big-search { display: flex; gap: 8px; max-width: 720px; margin: 0 auto; padding: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.big-search:focus-within { border-color: var(--primary); }
.big-search label { flex: 1; display: flex; align-items: center; gap: 10px; padding-left: 12px; }
.big-search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--text); height: 48px; min-width: 0; }
.big-search .ic { color: var(--faint); }
.popular { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; font-size: .88rem; color: var(--muted); }
.popular a { padding: 4px 12px; border-radius: 999px; background: var(--bg-sunken); color: var(--text-2); }
.hero-cta { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ── 폼 ── */
.form-grid { display: grid; gap: 18px; }
.field label, .label { display: block; font-weight: 650; font-size: .93rem; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.field .error, .error-text { font-size: .85rem; color: var(--danger-ink); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 44px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .92rem; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 650; height: 100%; background: var(--card); }
.choice span small { font-weight: 500; color: var(--muted); }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.choice input:focus-visible + span { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; }

/* 단계형 폼 */
.steps { display: flex; gap: 6px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step-dot { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--bg-sunken); color: var(--muted); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.step-dot b { width: 20px; height: 20px; border-radius: 50%; background: var(--line-strong); color: #fff; display: grid; place-items: center; font-size: .72rem; }
.step-dot.active { background: var(--primary-soft); color: var(--primary-ink); }
.step-dot.active b, .step-dot.done b { background: var(--primary); }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── 알림·안내 ── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); font-size: .94rem; }
.alert .ic { margin-top: 1px; }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok-ink); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn-ink); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger-ink); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info-ink); }
.alert-primary { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.alert p:last-child { margin: 0; }

/* "지금 내가 할 일"(추가1 B-6) */
.todo-banner { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--primary); color: #fff; }
.todo-banner .ic-lg { opacity: .9; }
.todo-banner strong { font-size: 1.12rem; display: block; line-height: 1.45; }
.todo-banner .left { background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 8px; font-weight: 700; font-size: .88rem; white-space: nowrap; }
.todo-banner .btn { background: #fff; color: var(--primary-ink); border-color: #fff; }
:root[data-theme="dark"] .todo-banner { background: #3730A3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .todo-banner { background: #3730A3; } }

/* 토스트 */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 13px; background: #111827; color: #fff; box-shadow: var(--shadow-lg); font-size: .94rem; animation: toast-in .25s ease; pointer-events: auto; }
.toast.error { background: #991B1B; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 빈 화면 */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--bg-sunken); display: grid; place-items: center; color: var(--faint); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* 로딩 스켈레톤 */
.skeleton { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-soft) 37%, var(--bg-sunken) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-thumb { aspect-ratio: 4 / 3; border-radius: var(--radius) var(--radius) 0 0; }

/* ── 탭 ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 12px 16px; font-weight: 650; color: var(--muted); border: 0; background: none; font: inherit; border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.active, .tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.tabs .count { background: var(--bg-sunken); border-radius: 99px; padding: 0 7px; font-size: .78rem; }
.seg { display: inline-flex; padding: 4px; background: var(--bg-sunken); border-radius: 12px; gap: 2px; }
.seg a, .seg button { padding: 8px 16px; border-radius: 9px; font-weight: 650; font-size: .92rem; color: var(--muted); border: 0; background: none; cursor: pointer; font: inherit; }
.seg .active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ── 표 ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .82rem; font-weight: 700; color: var(--muted); background: var(--bg-soft); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:hover td { background: var(--bg-soft); }

/* 정보 목록 */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: .95rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv.total { font-weight: 800; font-size: 1.05rem; border-top: 1px solid var(--line); border-bottom: 0; padding-top: 12px; margin-top: 4px; }

/* ── 타임라인(진행 단계) ── */
.progress-steps { display: flex; gap: 0; margin-top: 4px; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.progress-steps li { flex: 1; min-width: 74px; text-align: center; position: relative; font-size: .8rem; color: var(--faint); font-weight: 600; padding-top: 30px; }
.progress-steps li::before { content: ""; position: absolute; top: 10px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-strong); z-index: 1; }
.progress-steps li::after { content: ""; position: absolute; top: 18px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.progress-steps li:first-child::after { display: none; }
.progress-steps li.done { color: var(--text-2); }
.progress-steps li.done::before { background: var(--primary); border-color: var(--primary); }
.progress-steps li.done::after, .progress-steps li.current::after { background: var(--primary); }
.progress-steps li.current { color: var(--primary); font-weight: 800; }
.progress-steps li.current::before { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: .8rem; color: var(--faint); }

/* 마일스톤 */
.ms { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.ms + .ms { margin-top: 8px; }
.ms-num { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-sunken); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex-shrink: 0; }
.ms.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ms.is-done .ms-num { background: var(--ok); color: #fff; }

/* ── 메시지 ── */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - var(--header-h) - 56px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list a { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-list a.active { background: var(--primary-soft); }
.chat-list a:hover { color: inherit; background: var(--bg-soft); }
.chat-list .preview { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room { display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-soft); }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; }
.bubble-row.me { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: .95rem; white-space: pre-wrap; }
.bubble-row.me .bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.bubble-time { font-size: .72rem; color: var(--faint); white-space: nowrap; }
.bubble-warn { align-self: center; font-size: .82rem; background: var(--warn-soft); color: var(--warn-ink); padding: 8px 12px; border-radius: 10px; max-width: 90%; display: flex; gap: 8px; }
.bubble a { text-decoration: underline; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { flex: 1; min-height: 46px; max-height: 160px; resize: none; }
.quote-card { border: 1.5px solid var(--primary); border-radius: 14px; padding: 14px 16px; background: var(--card); color: var(--text); min-width: 240px; }

/* ── 비교 화면 ── */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.compare { border-collapse: collapse; min-width: 100%; font-size: .92rem; }
.compare th, .compare td { padding: 14px 16px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; min-width: 220px; }
.compare th:first-child, .compare td:first-child { min-width: 120px; position: sticky; left: 0; background: var(--bg-soft); font-weight: 700; color: var(--muted); font-size: .84rem; z-index: 1; }
.compare .best { color: var(--ok-ink); font-weight: 800; }

/* ── 사이드 메뉴(마이페이지·관리자) ── */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .95rem; }
.side-nav a:hover { background: var(--bg-sunken); color: var(--text); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary-ink); }
.side-nav .group { font-size: .76rem; font-weight: 700; color: var(--faint); padding: 16px 12px 6px; letter-spacing: .02em; }
.side-nav .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .74rem; }

/* 통계 타일 */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: .84rem; font-weight: 600; margin: 0; }
.stat .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.bar { height: 8px; background: var(--bg-sunken); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

/* ── 상세 페이지 ── */
.detail-hero { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
.detail-thumb { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.detail-thumb .thumb-title { font-size: 1.6rem; max-width: 70%; }
.detail-thumb .thumb-icon { width: 96px; height: 96px; right: 28px; top: 28px; }
.pkg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.pkg-tabs button { padding: 14px 6px; border: 0; background: var(--bg-soft); font: inherit; font-weight: 700; font-size: .85rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.pkg-tabs button.active { background: var(--card); color: var(--primary); border-bottom-color: var(--primary); }
.pkg-panel { display: none; padding: 20px; }
.pkg-panel.active { display: block; }
.prose { font-size: 1rem; line-height: 1.75; color: var(--text-2); }
.prose p { margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.review { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.trust-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.trust-row > div { background: var(--bg-soft); border-radius: 12px; padding: 12px; text-align: center; }
.trust-row b { display: block; font-size: 1.05rem; }
.trust-row span { font-size: .78rem; color: var(--muted); }

/* 안내 블록(이용 방법·안전거래) */
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: how; }
.how-item { padding: 24px; }
.how-item .num { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.escrow { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 32px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--line); }
.escrow-flow { display: flex; flex-direction: column; gap: 10px; }
.escrow-flow div { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--card); border-radius: 12px; border: 1px solid var(--line); font-weight: 650; }
.escrow-flow .ic { color: var(--ok); }
.banner-expert { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px; border-radius: var(--radius-lg); background: linear-gradient(120deg, #312E81, #4F46E5 60%, #6366F1); color: #fff; }
.banner-expert p { color: rgba(255,255,255,.85); margin: 6px 0 0; }
.banner-expert .btn { background: #fff; border-color: #fff; color: #312E81; }

/* 예시 데이터 안내 */
.demo-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px dashed #F59E0B; background: var(--warn-soft); color: var(--warn-ink); font-size: .88rem; }

/* ── 페이지네이션 ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); font-weight: 650; font-size: .92rem; background: var(--card); }
.pagination .active span, .pagination span[aria-current] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pagination .disabled span { color: var(--faint); }

/* ── 필터 패널 ── */
.filters { display: flex; flex-direction: column; gap: 18px; }
.filters h4 { font-size: .9rem; margin-bottom: 8px; }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ── 푸터 ── */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); font-size: .88rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.footer h4 { color: var(--text); font-size: .9rem; margin-bottom: 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer .biz { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.8; font-size: .82rem; }
.footer .biz span + span::before { content: " | "; color: var(--line-strong); }

/* ── 모달 ── */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(560px, calc(100% - 32px)); background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(17, 24, 39, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }

/* ── 관리자 ── */
.admin-body { background: var(--bg-soft); }
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-main { padding: 28px; min-width: 0; }
.admin-main h1 { font-size: 1.45rem; margin-bottom: 18px; }
.inbox-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.inbox-item:last-child { border-bottom: 0; }

/* ==========================================================================
   반응형 — 모바일 우선 확인 기준 360px
   ========================================================================== */
@media (max-width: 1080px) {
  .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-main, .detail-hero { grid-template-columns: minmax(0, 1fr) 320px; }
  .header-search { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 56px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .nav, .hide-mobile { display: none !important; }
  .only-mobile { display: initial; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-side, .layout-main, .detail-hero, .escrow { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner-expert { flex-direction: column; align-items: flex-start; padding: 24px; }
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--header-h) - var(--tabbar-h) - 32px); }
  .chat.has-room .chat-list { display: none; }
  .chat:not(.has-room) .chat-room { display: none; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side .side-nav { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; }
  .admin-side .side-nav .group { display: none; }
  .admin-side .side-nav a { white-space: nowrap; }
  .admin-main { padding: 18px 16px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .72rem; font-weight: 650; color: var(--muted); position: relative; }
  .tabbar a.active { color: var(--text); }
  .tabbar .ic { width: 23px; height: 23px; }
  .tabbar .tab-cta span.ring { width: 48px; height: 48px; margin-top: -18px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent); }
  .tabbar .tab-cta { color: var(--primary); }
  .tabbar .dot { top: 8px; right: calc(50% - 16px); }
  .toast-wrap { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  .todo-banner { flex-direction: column; align-items: flex-start; }
  .trust-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .page { padding: 20px 0 48px; }
  .section { padding: 28px 0; }
  .hero { padding: 36px 0 24px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .cat-item { padding: 10px 2px; font-size: .78rem; }
  .cat-icon { width: 48px; height: 48px; border-radius: 14px; }
  .grid-2, .grid-3, .grid-4.cards-1 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .s-card-body { padding: 10px 12px 12px; }
  .s-card-body h3 { font-size: .9rem; }
  .thumb-title { font-size: .9rem; }
  .thumb-icon { width: 38px; height: 38px; }
  .big-search { flex-direction: column; border-radius: 16px; }
  .big-search .btn { width: 100%; }
  .card-pad-lg { padding: 20px; }
  .escrow { padding: 20px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { flex-direction: column; align-items: flex-start; }
  .form-actions .btn { flex: 1; }
  .admin-main .table-wrap { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .header, .tabbar, .footer, .no-print { display: none !important; }
  body { padding: 0; }
}

/* 카드 전체 클릭(제목 링크 확장) */
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.p-card .badge, .p-card .p-card-foot a { position: relative; z-index: 2; }

/* 모바일: 서비스 상세 하단 고정 구매 바(구매 상자가 본문 아래에 있어서) */
.mobile-buy { display: none; }
@media (max-width: 860px) {
  .mobile-buy { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 44; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(17,24,39,.06); color: var(--text); }
  .mobile-buy small { display: block; font-size: .72rem; color: var(--muted); }
  .mobile-buy:hover { color: var(--text); }
  body:has(.mobile-buy) { padding-bottom: calc(var(--tabbar-h) + 64px + env(safe-area-inset-bottom)); }
  #buy { scroll-margin-top: calc(var(--header-h) + 12px); }
}

/* ==========================================================================
   추가3: 실사 사진 썸네일·프로필·배너
   ========================================================================== */
.avatar-photo { object-fit: cover; background: var(--bg-sunken); display: inline-block; }
.avatar-xl.avatar-photo, .avatar-lg.avatar-photo { box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line); }

/* 크몽식 썸네일: 사진 + 하단 그라데이션 + 굵은 제목 2줄 + 포인트 문구 */
.thumb-photo { padding: 0; background: #1f2937; }
.thumb-photo::before { content: none; }
.thumb-photo::after { background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.72) 100%); z-index: 1; }
.thumb-photo > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; }
.thumb-photo.flip > img { transform: scaleX(-1); }
.card-hover:hover .thumb-photo > img { filter: brightness(1.04); }
.thumb-sub { display: block; margin-top: 3px; font-size: .78em; font-weight: 650; letter-spacing: -.01em; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-card > div:first-child > a { display: block; }
.thumb-copy { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.thumb-photo .thumb-title { max-width: 100%; font-size: 1.12rem; font-weight: 850; letter-spacing: -.03em; line-height: 1.3; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.thumb-point { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: .74rem; font-weight: 800; color: #fff; background: var(--band); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
/* 변형 1: 제목 위쪽 + 위쪽 그라데이션 */
.thumb-s1::after { background: linear-gradient(0deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.66) 100%); }
.thumb-s1 .thumb-copy { top: 38px; bottom: auto; }
/* 변형 2: 하단 색 띠 */
.thumb-s2::after { background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.35) 100%); }
.thumb-s2 .thumb-copy { left: 0; right: 0; bottom: 0; padding: 8px 14px 10px; gap: 4px; background: color-mix(in srgb, var(--band) 88%, #000 12%); }
.thumb-s2 .thumb-point { background: #fff; color: var(--band); }
/* 변형 3: 왼쪽 색 막대 + 흰 글자 박스 */
.thumb-s3 .thumb-copy { left: 12px; right: auto; max-width: 78%; padding: 10px 12px 10px 14px; border-radius: 10px; background: rgba(17,24,39,.62); backdrop-filter: blur(4px); border-left: 4px solid var(--band); }
.thumb-s3 .thumb-point { background: transparent; padding: 0; height: auto; box-shadow: none; color: color-mix(in srgb, var(--band) 55%, #fff 45%); }

/* 예시 라벨: 작고 세련되게(썸네일 좌상단 반투명 칩) */
.demo-chip, .rec-chip { position: absolute; z-index: 3; top: 10px; height: 20px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center; white-space: nowrap; word-break: keep-all; flex-shrink: 0; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .02em; color: #fff; }
.demo-chip { left: 10px; background: rgba(0,0,0,.55); }
.rec-chip { right: 10px; background: #4F46E5; }
.badge-demo { height: 20px; padding: 0 7px; font-size: .68rem; font-weight: 700; background: var(--bg-sunken); color: var(--muted); border: 1px solid var(--line); }
:root[data-theme="dark"] .badge-demo { background: var(--bg-sunken); color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-demo { background: var(--bg-sunken); color: var(--muted); } }
.p-card.is-demo, .s-card.is-demo, .e-card.is-demo { background: var(--card); }
.demo-note { border-style: solid; border-color: var(--line); background: var(--bg-soft); color: var(--muted); font-size: .84rem; padding: 8px 12px; }

/* 서비스 카드 판매자 줄 */
.s-card-body .seller .avatar { width: 24px; height: 24px; font-size: .72rem; }
.s-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: .8rem; color: var(--muted); }

/* 전문가 뱃지 */
.ebadges { display: flex; flex-wrap: wrap; gap: 4px; }
.ebadge { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: .72rem; font-weight: 700; background: var(--bg-sunken); color: var(--text-2); }
.ebadge .ic-sm { width: 12px; height: 12px; }
.ebadge.top { background: #FEF3C7; color: #92400E; }
.ebadge.verified { background: var(--ok-soft); color: var(--ok-ink); }
.ebadge.fast { background: var(--info-soft); color: var(--info-ink); }
.ebadge.new { background: var(--primary-soft); color: var(--primary-ink); }
.ebadge.tax { background: var(--bg-sunken); color: var(--text-2); }
:root[data-theme="dark"] .ebadge.top { background: #3A2A05; color: #FCD34D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ebadge.top { background: #3A2A05; color: #FCD34D; } }

/* 카테고리 배너 */
.cat-banner { position: relative; overflow: hidden; border-radius: var(--radius-lg); min-height: 220px; display: flex; align-items: flex-end; color: #fff; margin-bottom: 18px; background: #111827; }
.cat-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,24,39,.86) 0%, rgba(17,24,39,.55) 55%, rgba(17,24,39,.15) 100%); }
.cat-banner-body { position: relative; z-index: 1; padding: 28px; max-width: 640px; }
.cat-banner h1 { color: #fff; }
.cat-banner p { color: rgba(255,255,255,.86); margin: 8px 0 0; }
.cat-banner .crumb { font-size: .82rem; color: rgba(255,255,255,.75); }
.cat-banner .crumb a { color: rgba(255,255,255,.9); }
.top-experts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.top-expert { display: flex; gap: 12px; align-items: center; padding: 14px; }

/* 서비스 상세: 사진 히어로·갤러리·통계·패키지 포함 항목 */
.detail-thumb.thumb-photo .thumb-title { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.svc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.svc-stats > div { background: var(--bg-soft); border-radius: 12px; padding: 12px 8px; text-align: center; }
.svc-stats b { display: block; font-size: 1.05rem; }
.svc-stats span { font-size: .76rem; color: var(--muted); }
.pkg-features { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.pkg-features li { display: flex; gap: 8px; align-items: flex-start; }
.pkg-features .ic-sm { color: var(--ok); margin-top: 3px; }
.review-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .82rem; color: var(--muted); }
.review-reply { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); font-size: .9rem; display: flex; gap: 10px; }
.review-reply .avatar { width: 28px; height: 28px; font-size: .72rem; }
.career-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.career-list li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.career-list li:last-child { border-bottom: 0; padding-bottom: 0; }

@media (max-width: 1080px) { .top-experts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .thumb-photo .thumb-title { font-size: .92rem; }
  .thumb-point { height: 20px; font-size: .66rem; padding: 0 7px; }
  .thumb-copy { left: 10px; right: 10px; bottom: 9px; gap: 4px; }
  .thumb-s3 .thumb-copy { max-width: 88%; padding: 8px 10px; }
  .cat-banner { min-height: 180px; }
  .cat-banner-body { padding: 20px; }
  .svc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-experts { grid-template-columns: minmax(0, 1fr); }
}
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 720px; margin: 26px auto 0; }
.home-stats > div { text-align: center; padding: 12px 6px; border-radius: 12px; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); }
.home-stats dt { font-size: .78rem; color: var(--muted); }
.home-stats dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
@media (max-width: 560px) { .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 관리자 안내 상자·도움말 */
.guide { background: var(--card); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.guide > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--primary-ink); }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::after { content: "펼치기"; margin-left: auto; font-size: .78rem; color: var(--muted); }
.guide[open] > summary::after { content: "접기"; }
.guide[open] .guide-what { display: none; }
.guide-what { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.guide-body { padding: 0 16px 14px; }
.guide-lead { margin: 0 0 12px; color: var(--text-2); }
.guide-tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.guide-task { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.guide-task ol { margin: 6px 0 0; padding-left: 1.2em; color: var(--text-2); }
.guide-task li { margin-bottom: 3px; }
.guide-caution { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn-ink); font-size: .88rem; }
.guide-caution .ic-sm { margin-top: 3px; }
.guide-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tip { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%; background: var(--bg-sunken); color: var(--muted); font-size: .72rem; font-weight: 800; cursor: help; vertical-align: middle; }
.tip:hover, .tip:focus { background: var(--primary); color: #fff; outline: none; }
.tip-box { display: none; position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: #111827; color: #fff; font-size: .82rem; font-weight: 500; line-height: 1.5; text-align: left; box-shadow: var(--shadow-lg); white-space: normal; }
.tip:hover .tip-box, .tip:focus .tip-box { display: block; }
@media (max-width: 560px) { .tip-box { left: auto; right: -8px; transform: none; max-width: 240px; } }

/* 전문가 카드(추가4 3번): 세로형 · 가운데 정렬 · 4열(태블릿 2열, 모바일 가로 스크롤) */
.avatar-72 { width: 72px; height: 72px; font-size: 1.6rem; }
.e-card { position: relative; padding: 22px 16px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; height: 100%; min-width: 0; }
.e-card .avatar-72 { margin-bottom: 4px; box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line); }
.e-card-name { margin: 0; font-size: 1rem; font-weight: 750; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-card-name a { color: var(--text); }
.e-card-type { height: 20px; font-size: .7rem; }
.e-card-line { margin: 0; max-width: 100%; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-card-line b { color: var(--text-2); font-weight: 650; }
.e-card-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.e-card .ebadges { justify-content: center; min-height: 22px; }
.e-card-btn { margin-top: auto; pointer-events: none; }
.e-card-invite { position: relative; z-index: 2; width: 100%; }
.e-card .demo-chip { top: 10px; left: 10px; }
.expert-row, .expert-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1080px) { .expert-row, .expert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .expert-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 6px; scrollbar-width: none; }
  .expert-row::-webkit-scrollbar { display: none; }
  .expert-row > .e-card { flex: 0 0 72%; max-width: 260px; scroll-snap-align: start; }
}
@media (max-width: 420px) { .expert-grid { grid-template-columns: minmax(0, 1fr); } }

.p-card-foot { gap: 8px; }
.s-card-meta > span, .rating { white-space: nowrap; }
/* 모바일 2열 카드: 사진이 가려지지 않게 포인트 문구는 숨기고 띠를 얇게(추가4 4번 점검) */
@media (max-width: 640px) {
  .s-card .thumb-point { display: none; }
  .thumb-s2 .thumb-copy { padding: 6px 10px 8px; }
  .s-card .thumb-sub { font-size: .72em; }
}
/* 관리자 표 안의 작은 입력칸: 높이 36px에 맞게 안쪽 여백을 줄여 글자가 잘리지 않게 */
.input-sm, .select-sm { height: 36px; min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: .9rem; line-height: 1.4; }
.select-sm { padding-right: 34px; background-position: right 8px center; }

/* ── 직거래 경고·제출 차단(추가5·6) ── */
.ic-guard { width: 18px; height: 18px; flex-shrink: 0; color: var(--guard-ink); }
.guard-banner { background: var(--guard-bg); border-bottom: 1px solid var(--guard-line); color: var(--guard-ink); font-size: .86rem; }
.guard-banner > summary { display: flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer; list-style: none; font-weight: 700; }
.guard-banner > summary::-webkit-details-marker { display: none; }
.guard-banner > summary::after { content: '접기'; margin-left: auto; font-weight: 500; font-size: .78rem; opacity: .8; }
.guard-banner:not([open]) > summary::after { content: '펼치기'; }
.guard-banner-body { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 0 14px 10px 40px; line-height: 1.5; }
.guard-banner-link { white-space: nowrap; font-weight: 700; color: var(--guard-ink); text-decoration: underline; }
.guard-card { align-self: flex-start; margin-left: 40px; max-width: min(78%, 520px); background: var(--guard-bg); border: 1px solid var(--guard-line); color: var(--guard-ink); border-radius: 12px; padding: 10px 12px; font-size: .84rem; margin-top: -4px; }
.guard-card-text { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; flex-wrap: wrap; }
.guard-card-types { display: block; width: 100%; padding-left: 26px; font-size: .76rem; opacity: .85; }
.guard-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-left: 26px; }
.guard-card-actions form { margin: 0; }
.guard-btn-primary { background: var(--guard-ink); color: var(--guard-bg); border-color: var(--guard-ink); }
.guard-btn-primary:hover { filter: brightness(1.1); color: var(--guard-bg); }
.file-note { align-self: flex-start; margin: -4px 0 0 40px; font-size: .74rem; color: var(--faint); }
.file-note.me { align-self: flex-end; margin: -4px 0 0; }
.guard-self { margin: 0 12px; padding: 6px 10px; font-size: .78rem; color: var(--guard-ink); background: var(--guard-bg); border-radius: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chat-hint { font-size: .74rem; color: var(--faint); margin-bottom: 4px; }
.guard-confirm h3 { display: flex; gap: 8px; align-items: center; }
.guard-confirm-actions { margin-top: 16px; }
.guard-rule { display: flex; gap: 10px; align-items: flex-start; background: var(--guard-bg); border: 1px solid var(--guard-line); color: var(--guard-ink); border-radius: 12px; padding: 12px 14px; font-size: .88rem; line-height: 1.55; }
.guard-rule .link { color: var(--guard-ink); text-decoration: underline; }
.is-guarded { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.guard-field { margin-top: 6px; }
.guard-note { color: var(--danger-ink); font-size: .82rem; font-weight: 600; }
.guard-preview { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--bg-soft); font-size: .84rem; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; color: var(--muted); }
.guard-mark { background: transparent; color: var(--danger-ink); text-decoration: underline wavy var(--danger); text-underline-offset: 3px; font-weight: 700; }
.guard-list { border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-soft); color: var(--danger-ink); border-radius: 10px; padding: 10px 12px; font-size: .86rem; margin-bottom: 10px; }
.guard-list ul { margin: 6px 0 0; padding-left: 18px; }
.guard-list .link { color: var(--danger-ink); text-align: left; background: none; border: 0; padding: 2px 0; cursor: pointer; text-decoration: underline; font: inherit; }
[data-guard-submit]:disabled { opacity: .5; cursor: not-allowed; }
.thumb-preview { display: block; width: 200px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin: 4px 0 8px; border: 1px solid var(--line); }
.safe-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.safe-steps li b { display: block; }
.safe-steps li span { color: var(--muted); font-size: .9rem; }
.list-dot { padding-left: 18px; line-height: 1.7; }
@media (max-width: 640px) {
  /* 확인 창은 하단 시트(추가5 6번) */
  dialog.modal.guard-confirm { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; }
  .guard-confirm-actions { flex-direction: column-reverse; }
  .guard-confirm-actions .btn { width: 100%; }
  .guard-banner-body { flex-direction: column; gap: 4px; padding-left: 14px; }
  .guard-card { margin-left: 0; max-width: 92%; }
  .file-note { margin-left: 0; }
}
/* 메시지 첨부: 클립 아이콘과 파일 이름을 한 줄로 */
.bubble-file { display: inline-flex; align-items: center; gap: 6px; word-break: break-all; }
.bubble-file svg { flex-shrink: 0; }

/* 주간/야간 전환 버튼 (추가9) — 자동=반쪽 원, 주간=해, 야간=달 */
.theme-btn { width: 36px; height: 36px; border-radius: 10px; }
.theme-btn .ti { display: none; }
.theme-btn .ti-auto { display: block; }
html[data-tj="light"] .theme-btn .ti-auto, html[data-tj="dark"] .theme-btn .ti-auto { display: none; }
html[data-tj="light"] .theme-btn .ti-light { display: block; }
html[data-tj="dark"] .theme-btn .ti-dark { display: block; }
.theme-btn::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; white-space: nowrap; padding: 5px 9px; border-radius: 8px; font-size: .75rem; line-height: 1.3; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .15s; }
.theme-btn.show-tip::after { opacity: 1; }
.admin-topbar { display: flex; justify-content: flex-end; margin: -10px 0 8px; }

/* 판매자가 만든 대표 이미지(글씨 포함): 4:3 그대로, 자르지 않고 덮지 않음 (2026-11-19) */
.thumb-designed { aspect-ratio: 4 / 3; background: #0f172a; }
.thumb-designed::after { content: none; }
.thumb-designed > img { object-fit: contain; }
.thumb-designed.flip > img { transform: none; }
.detail-thumb.thumb-designed { aspect-ratio: 4 / 3; width: 100%; max-width: 820px; margin-inline: auto; }
