:root {
  --bg: #fcfbfd;
  --ink: #302c3b;
  --muted: #706a7a;
  --line: #e9e5ee;
  --purple: #a999d4;
  --purple-dark: #685189;
  --purple-soft: #f0ebf8;
  --shadow: 0 8px 28px #302c3b0b;
}
body { background: var(--bg); font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
.is-loading main > section { display: none; }
.is-loading main::before { content: "불러오는 중..."; display: block; padding: 100px 20px; text-align: center; color: var(--muted); }
.primary-btn[aria-busy="true"]::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pendingSpin .7s linear infinite; }
@keyframes pendingSpin { to { transform: rotate(360deg); } }
@keyframes pageIn { from { opacity: .7; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
* { letter-spacing: 0; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #9c85c8; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .58; transform: none; }
input, select, textarea { min-width: 0; }
input[type="file"]::file-selector-button { border: 0; padding: 9px 12px; border-radius: 6px; background: var(--purple-soft); color: var(--purple-dark); font: inherit; cursor: pointer; margin-right: 8px; }
input:not([type="checkbox"]):not([type="range"]), select { min-height: 44px; }
button, a { touch-action: manipulation; }
img { max-width: 100%; }
h1, h2, h3, p, .mini-row, .chat-message { overflow-wrap: anywhere; }
.site-header { min-height: 72px; padding-block: 12px; background: #fffffff5; }
.brand { font-weight: 800; letter-spacing: 0; font-size: 18px; }
.brand-mark { background: #b7a5de; border-radius: 8px; }
.desktop-nav { gap: 2px; }
.desktop-nav button { font-size: 14px; font-weight: 600; }
.header-actions { gap: 8px; }
.session-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-btn { color: #38264f; background: #d9ccef; box-shadow: none; font-weight: 700; }
.primary-btn:hover { color: #30203f; background: #cbbbE6; box-shadow: 0 4px 12px #68518918; }
.ghost-btn, .light-btn { font-weight: 600; }
.text-btn { color: var(--purple-dark); }
.hero { min-height: 380px; border-radius: 0; box-shadow: none; grid-template-columns: 1fr; padding: 44px; background-position: center 55%; }
.hero::before { display: none; }
.hero h1 { font-size: 44px; line-height: 1.24; max-width: 560px; word-break: keep-all; }
.hero p { font-weight: 400; max-width: 500px; }
.hero .eyebrow { font-size: 12px; color: #f1eafa; }
.hero-panel { display: none; }
.hero-actions { gap: 10px; }
.hero-actions button { min-height: 46px; }
.content-band, .page-head, .mypage-card { padding: 24px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.content-band { margin-top: 16px; border-bottom: 1px solid var(--line); }
.page-head { margin: 0 0 20px; padding: 16px 0 8px; }
.page-head h1 { font-size: 28px; font-weight: 750; margin-bottom: 9px; }
.page-head p { font-size: 14px; line-height: 1.7; }
.section-title { margin-bottom: 20px; }
.section-title h2 { font-size: 21px; font-weight: 750; }
.character-rail { gap: 25px; padding: 0 0 12px; }
.character-chip img { box-shadow: none; border: 2px solid #eee9f5; }
.character-chip span { font-weight: 600; font-size: 12px; word-break: keep-all; }
.card, .post-card, .creator-card { border-radius: 8px; box-shadow: none; animation: none; border-color: var(--line); }
.card:hover, .post-card:hover, .creator-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px #302c3b0d; }
.card-img { aspect-ratio: 4 / 5; min-height: 0; height: auto; background-size: cover; }
.card-body { padding: 14px; }
.card-body h3 { font-size: 15px; line-height: 1.5; margin: 7px 0; }
.title-link { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.title-link:hover { color: var(--purple-dark); }
.meta { color: var(--muted); font-size: 12px; }
.price { font-size: 18px; color: var(--ink); }
.badge { color: #563c7a; background: #f0e9fb; font-weight: 600; }
.status-badge.hold { color: #72500e; background: #fff4d8; }
.status-badge.done { color: #51525b; background: #e8e8ee; }
.choice-chips button { border-radius: 6px; min-height: 40px; font-size: 13px; font-weight: 600; }
.choice-chips button.active { background: var(--purple-soft); color: var(--purple-dark); border-color: #cdbce2; box-shadow: none; }
.choice-chips { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; gap: 6px; }
.toolbar { background: #fff; border-radius: 8px; box-shadow: none; padding: 16px; border: 1px solid var(--line); gap: 10px; }
.community-tabs { border-radius: 0; box-shadow: none; background: transparent; }
.community-tabs button { color: #77717f; font-weight: 600; }
.community-tabs button.active { color: var(--purple-dark); }
.post-summary h3 { line-height: 1.5; }
.post-thumb { object-fit: cover; }
.post-foot { font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.trade-editor, .post-editor { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.trade-editor-hero, .post-editor-hero { background: transparent; color: var(--ink); border-bottom: 1px solid var(--line); padding: 18px 0; }
.trade-editor-hero, .post-editor-hero { display: none; }
.crop-preview { display: block; width: 100%; height: 260px; object-fit: contain; background: #eeebf3; border-radius: 8px; }
.crop-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.crop-controls label { display: grid; gap: 6px; font-size: 13px; }
.crop-controls input, .crop-controls select { width: 100%; }
.crop-controls .wide-field { grid-column: 1 / -1; }
.image-lightbox { width: min(1000px, calc(100% - 24px)); }
.image-lightbox img { display: block; max-height: 75dvh; margin: auto; object-fit: contain; }
.article-page { max-width: 820px; margin: auto; padding: 16px 0; }
.article-page .modal-head { margin-top: 32px; }
.article-page #detailTitle { font-size: 30px; line-height: 1.5; }
.article-page .detail-image { display: block; max-height: 650px; object-fit: contain; margin: 20px auto; border-radius: 8px; }
.article-page #detailBody { font-size: 16px; line-height: 1.95; }
.article-page #commentList .mini-row { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); padding: 16px 0; }
.article-page #commentList .meta { font-size: 14px; white-space: pre-wrap; line-height: 1.75; }
.comment-actions { display: flex; flex-shrink: 0; }
.article-page .detail-page-head { padding: 0; }
.trade-editor-hero h2, .post-editor-hero h2 { font-size: 24px; }
.trade-editor-hero p, .post-editor-hero p { color: var(--muted); }
.trade-editor-layout, .post-editor-layout { padding: 24px 0; gap: 28px; }
.post-editor-layout { grid-template-columns: minmax(0, 1fr) 280px; }
.post-writing-panel { grid-column: 1; grid-row: 1; min-width: 0; }
.post-media-panel { grid-column: 2; grid-row: 1; }
.editor-section-title > span, .editor-section-title small { display: none; }
.post-writing-panel .editor-section-title { display: none; }
.post-writing-panel .editor-section { border: 0; margin: 0; padding-bottom: 12px; }
#postTitle { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; font-size: 22px; padding: 16px 0; background: transparent; }
#postBody { border-radius: 8px; box-shadow: none; min-height: 350px; line-height: 1.9; padding: 18px; }
.editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; border-top: 1px solid var(--line); padding: 20px 0; }
.editor-actions .full { width: auto; min-width: 130px; padding-inline: 24px; border-radius: 8px; }
.editor-actions .form-message { margin: 0; }
.trade-media-panel, .post-media-panel, .editor-section { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0 0 24px; }
.editor-section { border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.editor-section-title { margin-bottom: 20px; }
.editor-section-title > span { background: #efe9f7; color: #72588e; box-shadow: none; border-radius: 6px; }
.editor-section-title small { line-height: 1.6; font-weight: 400; }
.field label { color: #554e62; font-weight: 600; }
.media-uploader { background: #f7f4fb; border: 1px dashed #cdbfe0; border-radius: 8px; padding: 16px; }
.form-message { color: #b23855; }
.detail-info-panel, .detail-gallery, .checkout-summary, .checkout-form, .order-pipeline { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.detail-info-panel h1 { font-size: 28px; line-height: 1.45; }
.detail-gallery > img { border-radius: 8px; object-fit: contain; background: #f3f0f6; }
.payment-ready-box { border-radius: 8px; background: #f3f7f5; border-color: #dce9e0; }
.payment-ready-box strong { line-height: 1.5; }
.order-card { border-radius: 8px; box-shadow: none; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.mypage-order-link { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px 0 28px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.mypage-order-link:hover, .mypage-order-link:focus-visible { border-color: #bca8dc; background: #faf8fd; }
.mypage-order-link strong, .mypage-order-link small { display: block; }
.mypage-order-link strong { font-size: 20px; }
.mypage-order-link small { margin-top: 5px; color: var(--muted); font-size: 13px; }
.mypage-order-link > span:last-child { flex-shrink: 0; color: var(--purple-dark); font-weight: 800; }
.mini-row { min-width: 0; border-radius: 8px; box-shadow: none; }
.mini-row > div, .mini-row > span, .creator-top > div { min-width: 0; }
.mini-row strong { display: block; }
.chat-shell { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; height: min(700px, calc(100dvh - 230px)); min-height: 420px; gap: 0; }
.chat-shell { grid-template-columns: clamp(210px, 24vw, 250px) minmax(0, 1fr); }
.chat-room-list, .chat-thread { border-radius: 0; border: 0; box-shadow: none; min-width: 0; min-height: 0; }
.chat-room-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-room { border-radius: 6px; }
.chat-room > span { min-width: 0; }
.chat-room strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chat-room { grid-template-columns: 44px minmax(0, 1fr) auto; }
.unread-count { background: #715591; color: white; font-size: 11px; min-width: 20px; padding: 1px 5px; border-radius: 10px; }
.has-unread::before { content: attr(data-unread-count); position: absolute; z-index: 2; top: 1px; right: 1px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: #b1446b; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; transform: translate(45%, -35%); }
.chat-blocked { padding: 8px 12px; margin: 0; font-size: 12px; color: #8c3752; background: #fcf1f5; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-thread-head { flex: 0 0 auto; padding: 16px; }
.chat-thread-head > .chat-thread-title { flex: 1; min-width: 0; }
.chat-thread-head > button { flex-shrink: 0; white-space: nowrap; }
.chat-thread-head .chat-leave-btn { color: #9d3151; }
.chat-thread-head > img { flex-shrink: 0; }
.chat-thread-head h2 { font-size: 16px; line-height: 1.5; }
.chat-thread-head img { width: 40px; height: 40px; border-radius: 6px; }
.chat-actions-menu { position: relative; flex: 0 0 auto; }
.chat-menu-toggle { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--purple-dark); cursor: pointer; }
.chat-menu-toggle:hover, .chat-menu-toggle:focus-visible, .chat-menu-toggle[aria-expanded="true"] { background: var(--purple-soft); border-color: #cdbfe0; }
.chat-menu-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chat-actions-popover { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; display: grid; min-width: 120px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(48, 35, 62, .16); }
.chat-actions-popover[hidden] { display: none; }
.chat-actions-popover button { width: 100%; padding: 10px 12px; border-radius: 7px; text-align: left; white-space: nowrap; }
.chat-actions-popover button:hover, .chat-actions-popover button:focus-visible { background: var(--purple-soft); }
.chat-messages { display: flex; flex: 1 1 0; flex-direction: column; align-content: initial; height: 0; min-height: 0; gap: 10px; overflow-x: hidden; overflow-y: scroll; overscroll-behavior: contain; scrollbar-gutter: stable; touch-action: pan-y; background: #faf9fc; }
.chat-messages::before { content: ""; margin-top: auto; }
.chat-messages::-webkit-scrollbar { width: 9px; }
.chat-messages::-webkit-scrollbar-track { background: #f1eef5; }
.chat-messages::-webkit-scrollbar-thumb { border: 2px solid #f1eef5; border-radius: 999px; background: #b9acc8; }
.chat-messages:focus-visible { outline: 2px solid #9b82c2; outline-offset: -2px; }
.chat-message { align-self: flex-start; width: min(72%, 520px); max-width: none; }
.chat-message.mine { align-self: flex-end; }
.chat-bubble-row { display: flex; align-items: flex-end; gap: 7px; }
.chat-message.mine .chat-bubble-row { flex-direction: row-reverse; }
.chat-bubble-content { width: fit-content; max-width: calc(100% - 62px); min-width: 0; }
.chat-message p { font-size: 14px; font-weight: 400; line-height: 1.7; white-space: pre-wrap; }
.chat-message.mine p { background: #e9dff5; color: #392e47; border: 0; }
.message-side-meta { display: grid; flex-shrink: 0; justify-items: end; gap: 2px; padding-bottom: 2px; color: #77717f; font-family: inherit; font-size: 11px; font-weight: 400; line-height: 1.4; text-align: right; }
.chat-message .message-read-state, .chat-message .message-time { display: block; justify-self: end; margin: 0; padding: 0; color: inherit; font-family: inherit; font-size: 11px; font-weight: 400; line-height: 1.4; text-align: right; white-space: nowrap; }
.chat-compose { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; padding: 12px; border-top: 1px solid var(--line); }
.chat-compose textarea { min-height: 46px; max-height: 140px; font-size: 16px; }
.chat-back { display: none; }
.floating-chat { color: #38264f; background: #ddcfef; box-shadow: 0 5px 18px #4a326b22; }
body:has(#chat.active) .floating-chat { display: none; }
body:has(#postWrite.active, #tradeWrite.active) .floating-chat { display: none; }
.modal { border-radius: 12px; padding: 24px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal[open] { animation: dialogIn 180ms ease-out; }
.modal-head h2 { font-size: 22px; line-height: 1.4; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 100; max-width: min(520px, calc(100% - 32px)); padding: 14px 20px; background: #332c40; color: white; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; }
.connection-status { position: fixed; top: 72px; left: 0; right: 0; padding: 8px; text-align: center; z-index: 90; background: #fff0d8; color: #724c10; font-size: 13px; }
.connection-error { padding: 80px 16px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 110; padding: 12px; color: var(--ink); background: #fff; }
.skip-link:focus { top: 12px; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1100px) { .desktop-nav button { padding-inline: 10px; } .session-label { display: none; } }
@media (max-width: 900px) {
  .post-editor-layout { grid-template-columns: 1fr; }
  .post-writing-panel, .post-media-panel { grid-column: auto; grid-row: auto; }
  .post-writing-panel { order: -1; }
  .site-header { min-height: 64px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
  .mobile-nav button { min-width: 0; min-height: 44px; font-size: 11px; padding: 8px 2px; border-radius: 6px; word-break: keep-all; }
  .mobile-nav button.active { transform: none; }
  .hero { padding: 32px; min-height: 340px; }
  .hero h1 { font-size: 36px; }
}
@media (max-width: 700px) {
  main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .hero { padding: 28px 22px; min-height: 310px; background-position: 60% center; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 14px; }
  .hero .eyebrow { font-size: 11px; }
  .brand { font-size: 15px; gap: 7px; }
  .brand-mark { width: 28px; height: 28px; }
  .header-actions button { padding: 8px 10px; font-size: 12px; }
  .header-actions { gap: 4px; }
  .content-band, .page-head, .mypage-card { padding: 20px 0; }
  .page-head { margin-bottom: 8px; }
  .page-head h1 { font-size: 24px; }
  .section-title h2 { font-size: 19px; }
  .section-title { margin-bottom: 16px; }
  .row-head { align-items: center; gap: 12px; }
  .row-head > button { flex-shrink: 0; font-size: 13px; padding: 10px 13px; }
  .character-rail { gap: 12px; }
  .character-chip { width: 78px; }
  .character-chip img { width: 62px; height: 62px; }
  .card-body { padding: 11px; }
  .card-body h3 { font-size: 14px; }
  .card-body .meta { font-size: 11px; }
  .price { font-size: 16px; }
  .status-badge, .badge { font-size: 11px; }
  .toolbar { padding: 12px; }
  .toolbar .choice-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .toolbar .choice-chips button { flex-shrink: 0; min-height: 38px; padding: 8px 10px; font-size: 12px; }
  .creator-grid { grid-template-columns: 1fr; }
  .detail-info-panel { padding: 16px 0; }
  .detail-info-panel h1 { font-size: 23px; }
  .detail-page-actions { flex-wrap: wrap; }
  .trade-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-shell { display: block; height: calc(100dvh - 238px); min-height: 330px; }
  .chat-room-list, .chat-thread { height: 100%; }
  .chat-thread { display: none; }
  .chat-view.room-open .chat-room-list { display: none; }
  .chat-view.room-open .chat-thread { display: flex; }
  .chat-back { display: block; font-size: 12px; padding: 8px; }
  .chat-thread-head .chat-back { min-width: 44px; }
  .chat-thread-head > img { display: none; }
  .chat-compose { --chat-control-height: 52px; gap: 6px; padding: 10px; }
  .chat-compose .primary-btn { padding: 10px; font-size: 12px; }
  .attach-btn { width: var(--chat-control-height); min-width: var(--chat-control-height); padding: 10px; }
  .chat-thread-head { padding: 10px; gap: 8px; }
  .chat-menu-toggle { width: 38px; height: 38px; }
  .chat-message { width: 88%; max-width: none; }
  .modal { padding: 20px; }
  input, textarea, select { font-size: 16px; }
  .notice { flex-wrap: wrap; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.consent-fields { border-top: 1px solid #e8e5ee; padding-top: 12px; }
[hidden] { display: none !important; }
.privacy-case { padding: 16px 0; border-bottom: 1px solid #e8e5ee; overflow-wrap: anywhere; }
.privacy-case p, .privacy-case blockquote { white-space: pre-wrap; }
.support-link { align-self: center; color: #62516f; font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
#privacyRequestForm, .privacy-case form { display: grid; gap: 12px; }
#privacyRequestForm textarea, .privacy-case textarea { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 112px; padding: 12px; border: 1px solid #d9d4e2; border-radius: 6px; font: inherit; line-height: 1.6; }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.consent-row .check-row { flex: 1; min-width: 0; }
.consent-row > button { flex: 0 0 auto; min-height: 44px; }
.policy-dialog { width: min(640px, calc(100% - 24px)); max-height: 85dvh; overflow: auto; }
.policy-dialog h3 { margin: 24px 0 8px; font-size: 17px; }
.policy-dialog p { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.policy-footer { display: flex; flex-wrap: wrap; gap: 16px; padding: 28px 0 80px; border-top: 1px solid #e8e5ee; margin-top: 32px; }
@media (max-width: 767px) {
  .floating-chat { display: none; }
}
