/* ───── 크리에이터 마켓 (app.css · account.css 의 색 · 간격을 그대로 씀) ───── */
.market { margin-top: 64px; scroll-margin-top: 90px; }
.sell-start { border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 30px; padding: 8px 16px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sell-start:hover { background: #172d5c; }
.market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card .card-art { aspect-ratio: 1.33; }
.product-card .card-body > b { font-size: 16px; }
.product-card .card-foot { margin-top: 14px; }
.seller { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.product-price { font-size: 13px; font-weight: 800; color: #2347c5; white-space: nowrap; }
.label.kind-workflow, .kind-badge.kind-workflow { background: #e9efff; color: #2347c5; }
.label.kind-filter, .kind-badge.kind-filter { background: #e8f7ef; color: #17693d; }
.label.kind-prompts, .kind-badge.kind-prompts { background: #fff1e0; color: #9a5b00; }
.label.kind-guide, .kind-badge.kind-guide { background: #f2ebff; color: #5b34b0; }
.market-empty { grid-column: 1 / -1; border: 1px dashed #cfd8e8; border-radius: 16px; padding: 36px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--muted); font-size: 13px; }
.market-empty b { color: var(--navy); font-size: 16px; }

.kind-badge, .status-badge { display: inline-block; font-size: 11px; font-weight: 750; border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.status-badge { background: #eef1f6; color: #4b5b78; }
.status-badge.st-approved { background: #e8f7ef; color: #17693d; }
.status-badge.st-pending { background: #fff4dc; color: #9a5b00; }
.status-badge.st-rejected { background: #fff0f1; color: #a52c36; }
.status-badge.st-hidden { background: #eceef2; color: #6c7890; }

/* 상품 상세 */
.product-modal { width: min(980px, calc(100vw - 32px)); }
.product-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.product-head h2 { flex-basis: 100%; font-size: 26px; letter-spacing: -.6px; margin-top: 4px; }
.product-meta { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.product-summary { flex-basis: 100%; font-size: 14px; color: #33425e; margin-top: 4px; }
.gallery { display: flex; gap: 10px; overflow-x: auto; margin: 20px 0 6px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.gallery a { flex: 0 0 auto; scroll-snap-align: start; }
.gallery img, .gallery svg { display: block; height: 260px; max-width: 80vw; width: auto; border-radius: 12px; object-fit: cover; background: #eef2f8; }
.gallery svg { width: 260px; padding: 90px; color: #5676c1; }
.product-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-top: 20px; align-items: start; }
.description { font-size: 14px; line-height: 1.8; color: #2c3a55; overflow-wrap: anywhere; }
.description h4, .guide-body h4 { font-size: 17px; margin: 18px 0 6px; }
.description h5, .guide-body h5 { font-size: 15px; margin: 14px 0 4px; }
.description ul, .guide-body ul { padding-left: 20px; margin: 6px 0; }
.description p, .guide-body p { margin: 0 0 10px; }
.description code, .guide-body code { background: #f1f4fa; border-radius: 4px; padding: 1px 5px; font-size: .92em; }
.product-about .tags { margin-top: 16px; }
.product-action { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 12px; background: #fbfcff; position: sticky; top: 0; }
.price-box { display: grid; gap: 2px; }
.price-box b { font-size: 22px; letter-spacing: -.5px; }
.price-box small { font-size: 11px; color: var(--muted); }
.price-box.owned b { color: #17693d; font-size: 18px; }
.run-form .field { margin-bottom: 14px; }
.run-form textarea { min-height: 90px; }
.run-result img, .run-result video { display: block; width: 100%; border-radius: 10px; margin: 8px 0; }
.run-result audio { width: 100%; margin: 8px 0; }
.locked { border-top: 1px dashed var(--line); padding-top: 12px; font-size: 13px; }
.locked ul { margin: 8px 0 0; padding-left: 18px; color: #44536e; font-size: 12px; line-height: 1.8; }
.owner-note { margin-top: 18px; font-size: 12px; color: var(--muted); }
.link-button { border: 0; background: none; color: #254bca; text-decoration: underline; text-underline-offset: 3px; padding: 0; font-size: inherit; }
.unlocked { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.unlocked > h3 { font-size: 18px; margin-bottom: 14px; }
.guide-body { font-size: 14px; line-height: 1.85; color: #2c3a55; overflow-wrap: anywhere; }
.guide-body.tip { background: #f6f8fd; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: 13px; }
.prompt-list { display: grid; gap: 14px; }
.prompt-item { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.prompt-item:not(:has(> img)) { grid-template-columns: minmax(0, 1fr); }
.prompt-item > img { width: 160px; height: 160px; object-fit: cover; border-radius: 10px; }
.prompt-text { display: grid; gap: 8px; min-width: 0; }
.prompt-text pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8fd; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; margin: 0; font-family: inherit; }
.prompt-text p { margin: 0; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vars input { flex: 1; min-width: 110px; padding: 8px 10px; border: 1px solid #d7dfec; border-radius: 8px; font-size: 12px; }
.prompt-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.prompt-buttons .primary { width: auto; }
.admin-review { margin-top: 28px; padding: 18px; border: 1px solid #f0d58b; background: #fffbea; border-radius: 14px; display: grid; gap: 10px; }
.admin-review h3 { font-size: 15px; }
.admin-review .primary { width: auto; }
.admin-review input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #d7dfec; border-radius: 8px; font-size: 13px; }
.payload { max-height: 320px; overflow: auto; font-size: 11px; background: #fff; border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 스튜디오 */
.studio-modal { width: min(1040px, calc(100vw - 32px)); }
.studio-tabs { display: flex; gap: 4px; background: #f1f4fa; border-radius: 10px; padding: 4px; margin-bottom: 18px; overflow-x: auto; }
.studio-tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; font-weight: 650; color: #66738a; font-size: 13px; white-space: nowrap; }
.studio-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 2px 6px rgb(20 42 83 / 10%); }
.row-list { display: grid; gap: 8px; }
.product-row { display: flex; align-items: center; gap: 14px; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 14px 10px 10px; text-align: left; }
.product-row:hover { border-color: #b7c5f5; }
.row-thumb { width: 56px; height: 56px; border-radius: 9px; overflow: hidden; background: #eef2f8; display: grid; place-items: center; flex-shrink: 0; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb svg { width: 24px; height: 24px; color: #5676c1; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { font-size: 11px; color: var(--muted); }
.row-main small.reject { color: #a52c36; }
.row-side { font-size: 12px; color: #2347c5; font-weight: 650; white-space: nowrap; }
.new-product { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; background: #fbfcff; }
.new-product summary { cursor: pointer; font-weight: 750; font-size: 14px; }
.new-product .primary { width: auto; }
.new-product .pay-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #d7dfec; border-radius: 8px; font-size: 13px; }
.kind-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.kind-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #d9e1ee; background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; }
.kind-option:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.kind-option input { margin-top: 3px; accent-color: var(--blue); }
.kind-option span { display: grid; gap: 3px; }
.kind-option b { font-size: 14px; }
.kind-option small { font-size: 11px; color: var(--muted); line-height: 1.6; }
.muted.empty { padding: 28px 0; text-align: center; }

.editor-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.image-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.image-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.image-grid figcaption { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11px; flex-wrap: wrap; }
.image-grid figcaption label { display: inline-flex; gap: 3px; align-items: center; }
.image-grid .text-danger { margin-left: auto; padding: 2px 4px; }
.kind-editor { margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.kind-editor h3 { font-size: 16px; }
.editor-actions { position: sticky; bottom: -32px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff; border-top: 1px solid var(--line); margin: 22px -32px -32px; padding: 14px 32px; z-index: 3; }
.editor-actions .primary { width: auto; min-width: 120px; }
.editor-actions .spacer { flex: 1; }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field.inline label { width: auto; margin: 0; white-space: nowrap; }
.field.inline select { width: auto; }

.steps { margin: 0 0 14px; padding-left: 20px; font-size: 12px; color: #44536e; line-height: 1.8; }
.json-input { font-family: Consolas, "SFMono-Regular", monospace; font-size: 11px; width: 100%; margin: 10px 0; padding: 10px; border: 1px solid #d7dfec; border-radius: 8px; }
.node-table { display: grid; gap: 6px; }
.node { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.node summary { cursor: pointer; padding: 10px 12px; font-size: 13px; }
.binding { border-top: 1px solid #f0f2f7; padding: 8px 12px; display: grid; gap: 8px; }
.binding-head { display: flex; align-items: center; gap: 10px; }
.binding-head code { font-size: 12px; font-weight: 700; flex-shrink: 0; }
.binding-head .value { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binding select, .binding input[type=text] { padding: 7px 9px; border: 1px solid #d7dfec; border-radius: 7px; font-size: 12px; background: #fff; min-width: 0; }
.binding-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #f6f8fd; border-radius: 8px; padding: 8px; }
.binding-edit input[type=text] { flex: 1 1 140px; }
.check { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }

.filter-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 22px; align-items: start; }
.sliders { display: grid; gap: 6px; }
.slider { display: grid; grid-template-columns: 84px minmax(0, 1fr) 38px; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; }
.slider input { width: 100%; accent-color: var(--blue); }
.slider output { text-align: right; font-variant-numeric: tabular-nums; color: #44536e; }
.filter-preview { position: sticky; top: 0; display: grid; gap: 10px; }
.filter-preview canvas { width: 100%; height: auto; border-radius: 12px; background: #eef2f8 repeating-conic-gradient(#e3e8f1 0 25%, transparent 0 50%) 0 0 / 20px 20px; min-height: 200px; }
.filter-preview input[type=file] { flex: 1; min-width: 0; font-size: 11px; }

.prompt-editor { display: grid; gap: 12px; margin-bottom: 12px; }
.prompt-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 0; }
.prompt-edit legend { display: flex; gap: 10px; align-items: center; font-weight: 750; font-size: 13px; padding: 0 6px; }
.prompt-edit .field { margin-bottom: 12px; }
.prompt-edit .pay-row .field { flex: 1; min-width: 140px; }
.guide-input { min-height: 320px !important; font-size: 13px; line-height: 1.7; }

.payout-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; }
.payout-form input { min-width: 0; padding: 10px 12px; border: 1px solid #d7dfec; border-radius: 8px; font-size: 13px; }
.payout-form .primary { width: auto; }
.payout-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.payout-row > div:first-child { display: grid; gap: 2px; }
.payout-row small { font-size: 11px; color: var(--muted); }
.payout-row input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid #d7dfec; border-radius: 8px; font-size: 12px; }
.payout-row .primary { width: auto; }

@media (max-width: 1100px) {
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .product-grid, .editor-grid, .filter-editor { grid-template-columns: minmax(0, 1fr); }
  .product-action, .filter-preview { position: static; }
  .payout-form { grid-template-columns: 1fr 1fr; }
  .payout-form .primary { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .market { margin-top: 44px; }
  .market-grid { grid-template-columns: minmax(0, 1fr); }
  .kind-pick { grid-template-columns: minmax(0, 1fr); }
  .gallery img, .gallery svg { height: 200px; }
  .prompt-item { grid-template-columns: minmax(0, 1fr); }
  .prompt-item > img { width: 100%; height: auto; aspect-ratio: 1; }
  .editor-actions { margin: 22px -18px -22px; padding: 12px 18px; bottom: -22px; }
  .product-head h2 { font-size: 22px; }
}

/* 사용 → 계약 → 실행 · 개인 KEY */
.use-button { width: 100%; padding: 13px; font-size: 15px; }
.use-steps { margin: 0; padding-left: 18px; font-size: 12px; color: #44536e; line-height: 1.8; }
.notice { background: #fff4dc; color: #7a4800; border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.6; }
.contract, .keys { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.contract > h3, .keys > h3 { font-size: 18px; }
.contract-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contract-head > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; background: #fbfcff; min-width: 0; }
.contract-head span { font-size: 11px; color: var(--muted); }
.contract-head b { font-size: 14px; overflow-wrap: anywhere; }
.contract-price b { font-size: 20px; color: #2347c5; }
.contract-items { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.contract-items li b { font-size: 13px; }
.contract-items li p { margin: 2px 0 0; font-size: 13px; line-height: 1.7; color: #33425e; }
.contract .check { font-size: 13px; font-weight: 650; gap: 8px; }
.fee-policy { background: #f6f8fd; border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.7; color: #33425e; }
.fee-policy p { margin: 4px 0 6px; }
.fee-policy ul { margin: 0; padding-left: 18px; }
.key-list { display: grid; gap: 8px; }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.key-row > div { display: grid; gap: 2px; min-width: 0; }
.key-row code, .key-secret code { font-size: 12px; overflow-wrap: anywhere; }
.key-row small { font-size: 11px; color: var(--muted); }
.key-secret { display: grid; gap: 8px; border: 1px solid #9bd3b2; background: #effaf3; border-radius: 12px; padding: 12px 14px; font-size: 12px; }
.key-secret code { background: #fff; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.key-secret button { justify-self: start; }
button.small { padding: 5px 12px; font-size: 12px; }
.api-example summary { cursor: pointer; font-size: 13px; font-weight: 650; }
.api-example pre { background: #0f1b33; color: #dfe7ff; border-radius: 10px; padding: 12px 14px; font-size: 12px; overflow-x: auto; margin-top: 8px; }

/* 판매자 퀘스트 */
.quest { display: grid; gap: 14px; }
.quest-banner { border: 1px solid #f1d9a6; background: #fffaf0; border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; margin-bottom: 14px; }
.quest .quest-banner { margin-bottom: 0; }
.quest-banner.active { border-color: #9bd3b2; background: #effaf3; }
.quest-banner p { margin: 0; font-size: 13px; color: #44536e; }
.quest-banner button { justify-self: start; }
.quest-bar { height: 8px; border-radius: 8px; background: #eceff5; overflow: hidden; }
.quest-bar span { display: block; height: 100%; background: #2f6bff; border-radius: 8px; }
.quest-banner.active .quest-bar span { background: #1f9254; }
.quest-step { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.quest-step.done { background: #fbfdfb; }
.quest-title { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.quest-title small { grid-column: 2; font-size: 12px; color: var(--muted); }
.quest-mark { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: #eef1f6; color: #4b5b78; }
.quest-step.done .quest-mark { background: #1f9254; color: #fff; }
.quest-step.done .quest-title small { color: #17693d; font-weight: 650; }
.quest-form { display: grid; gap: 10px; }
.quest-form > button { justify-self: start; width: auto; min-width: 140px; }
@media (max-width: 600px) {
  .contract-head { grid-template-columns: 1fr; }
  .key-row { align-items: flex-start; }
}
