/* 하단 탭 바 */
#tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
#tab-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; font-size: var(--fs-12); color: var(--muted);
}
#tab-bar a[aria-current="page"] { color: var(--ink); font-weight: 700; }
#tab-bar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: var(--tap); padding: 0 var(--sp-16);
  border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); font-weight: 600;
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .4; cursor: default; }

/* 입력 */
.input {
  width: 100%; min-height: var(--tap); padding: 0 var(--sp-12);
  border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface);
  font-size: var(--fs-16); /* 16px 미만이면 iOS 가 확대함 */
}

/* 필터 칩 바 */
.chips { display: flex; gap: var(--sp-8); overflow-x: auto; padding: var(--sp-8) var(--sp-16); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 var(--sp-12);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: var(--fs-14); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 작품 격자 (사진이 주인공) */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.work-card { position: relative; background: var(--line); aspect-ratio: 4 / 5; overflow: hidden; }
.work-card img { width: 100%; height: 100%; object-fit: cover; }
.work-card .meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--sp-8);
  font-size: var(--fs-12); color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.work-card .price { font-weight: 700; }

/* 인증 배지 */
.badges { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: var(--fs-12); font-weight: 600; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }

/* 빈 상태 */
.empty { padding: 64px var(--sp-16); text-align: center; color: var(--muted); }
.empty .btn { margin-top: var(--sp-16); }

/* 미리보기 띠 */
.preview-banner { padding: var(--sp-8) var(--sp-16); font-size: var(--fs-12); text-align: center; background: var(--ink); color: var(--paper); }

/* 목록 행 */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list a, .list button.row {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 52px; padding: 0 var(--sp-4); border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
}

/* 토스트 */
#toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--radius-m);
  background: var(--ink); color: var(--paper); font-size: var(--fs-14);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 카카오 로그인 버튼 (카카오 가이드 색) */
.btn.kakao { background: #FEE500; color: #191919; border-color: #FEE500; }
.artist-card { display: block; }

/* 이미지 업로더 */
.uploader { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--sp-8); }
.up-item, .up-add { position: relative; aspect-ratio: 1; border-radius: var(--radius-s); overflow: hidden; background: var(--line); }
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-item.loading { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .4; } }
.up-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; }
.up-cover { position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: 11px; }
.up-add { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--muted); background: none; color: var(--muted); font-size: 24px; }
.up-add small { font-size: var(--fs-12); }

/* 폼 */
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--fs-14); font-weight: 600; }
.field .hint { font-size: var(--fs-12); color: var(--muted); font-weight: 400; }
textarea.input { min-height: 120px; padding: var(--sp-12); line-height: 1.5; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
.check { display: flex; align-items: center; gap: var(--sp-8); min-height: var(--tap); }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.option-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 44px; gap: 6px; align-items: center; }
.option-row .input { padding: 0 8px; }
.sticky-cta { position: sticky; bottom: 0; padding: var(--sp-12) 0 calc(var(--sp-12) + env(safe-area-inset-bottom)); background: var(--paper); }

/* 파트너센터 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
.stat { padding: var(--sp-12); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.stat b { display: block; font-size: var(--fs-20); }
.stat span { font-size: var(--fs-12); color: var(--muted); }
.ev-row { display: grid; grid-template-columns: 72px 1fr auto; gap: var(--sp-12); align-items: center; padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); }
.ev-row img, .ev-row .ph { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-s); background: var(--line); }
.ev-row .title { font-weight: 600; }
.status-tag { font-size: var(--fs-12); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-tag.active { color: var(--ok); border-color: var(--ok); }

/* 이벤트 카드 */
.event-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-16) var(--sp-12); padding: var(--sp-8) var(--sp-16) var(--sp-24); }
@media (min-width: 600px) { .event-grid { grid-template-columns: repeat(3, 1fr); } }
.event-card { display: block; min-width: 0; }
.ec-img { aspect-ratio: 4 / 5; border-radius: var(--radius-m); overflow: hidden; background: var(--line); }
.ec-img img { width: 100%; height: 100%; object-fit: cover; }
.ec-body { padding-top: var(--sp-8); display: grid; gap: 2px; }
.ec-artist { font-size: var(--fs-12); color: var(--muted); display: flex; gap: 4px; align-items: center; }
.ec-check { color: var(--ok); font-weight: 700; }
.ec-title { font-size: var(--fs-14); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ec-price { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ec-price b { font-size: var(--fs-16); }
.ec-price s { font-size: var(--fs-12); }
.ec-off { color: var(--accent); font-weight: 700; }
.ec-meta { font-size: var(--fs-12); color: var(--muted); }

/* 이벤트 상세 */
.ev-hero { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: var(--line); }
.ev-hero img { flex: none; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: start; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table td { padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); }
.price-table td:last-child { text-align: right; white-space: nowrap; }
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-16) calc(var(--sp-12) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
