:root {
  --bg: #fcfbff;
  --surface: #ffffff;
  --ink: #171321;
  --muted: #918b9e;
  --line: #eee9fa;
  --purple: #8f84ff;
  --purple-dark: #766bf0;
  --purple-soft: #f4f1ff;
  --purple-pale: #ded7ff;
  --pink: #f7a7d1;
  --blue: #9cb8ff;
  --green: #059669;
  --shadow: 0 20px 48px rgba(57, 35, 118, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Malgun Gothic", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    linear-gradient(180deg, rgba(244,241,255,.9), rgba(255,255,255,0) 26rem),
    linear-gradient(115deg, rgba(255,247,252,.75), rgba(246,251,255,.58)),
    var(--bg);
}
button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
button:active { transform: translateY(1px) scale(.99); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .04em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #9f8fff, #d8ccff);
  color: white;
}
.desktop-nav { display: flex; gap: 8px; }
.desktop-nav button, .ghost-btn, .text-btn, .light-btn, .primary-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}
.desktop-nav button {
  position: relative;
}
.desktop-nav button.active, .desktop-nav button:hover { background: var(--purple-soft); color: var(--purple-dark); }
.desktop-nav button.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: var(--purple);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.session-label { color: var(--muted); font-size: .9rem; }
.ghost-btn { border: 1px solid var(--line); background: var(--surface); }
.primary-btn { background: linear-gradient(135deg, #8f7cff, #aa99ff); color: white; box-shadow: 0 10px 24px rgba(143,124,255,.22); }
.primary-btn:hover { background: linear-gradient(135deg, #8578fa, #a99dff); box-shadow: 0 14px 30px rgba(143,124,255,.28); }
.light-btn { background: white; color: var(--purple-dark); }
.text-btn { color: var(--purple); padding-inline: 8px; }
.full { width: 100%; border-radius: 12px; justify-content: center; }

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 92px;
}
.view { display: none; }
.view.active {
  display: block;
  animation: pageIn .32s ease both;
}
.write-view {
  max-width: 1080px;
  margin: 0 auto;
}
.write-view .composer-panel {
  margin-top: 18px;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 26px;
  min-height: 360px;
  align-items: end;
  padding: clamp(26px, 6vw, 58px);
  color: white;
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(23,18,35,.78) 0%, rgba(69,52,103,.52) 42%, rgba(255,255,255,.02) 100%),
    url("assets/images/hero-ai-cosphere.png") center/cover;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 12%, rgba(255,255,255,.18) 28%, transparent 44%);
  transform: translateX(-70%);
  animation: softSweep 7s ease-in-out infinite;
}
@keyframes softSweep {
  0%, 48% { transform: translateX(-72%); opacity: 0; }
  62% { opacity: 1; }
  100% { transform: translateX(72%); opacity: 0; }
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}
.hero p { max-width: 620px; color: rgba(255,255,255,.84); font-size: 1.05rem; font-weight: 700; }
.eyebrow { margin: 0; color: #d8c9ff !important; font-weight: 900; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-actions .primary-btn,
.hero-actions .light-btn {
  min-width: 118px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.25);
}
.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
}
.stat { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: rgba(255,255,255,.12); border-radius: 14px; }
.stat strong { font-size: 1.7rem; }
.stat span { color: rgba(255,255,255,.8); }

.content-band, .page-head, .mypage-card {
  margin-top: 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 8px 28px rgba(20,14,34,.05);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.section-title, .row-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.22; letter-spacing: 0; }
.page-head h1, .section-title h2 { margin-bottom: 4px; }
.page-head p, .muted { color: var(--muted); margin-bottom: 0; }
.character-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.character-chip {
  width: 92px;
  flex: 0 0 auto;
  text-align: center;
}
.character-chip img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  background: linear-gradient(135deg, #f2edff, #ffe8f3);
  border: 2px solid #eee7ff;
  box-shadow: 0 8px 22px rgba(76,29,149,.12);
}
.character-chip span {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: .83rem;
  font-weight: 800;
  line-height: 1.25;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}
.native-select {
  display: none;
}
.choice-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.toolbar .choice-chips {
  min-height: 48px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 22px rgba(57,35,118,.04);
}
.wide-chips {
  grid-column: 1 / -1;
}
.choice-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 13px;
  background: #f7f4ff;
  color: #80778e;
  font-weight: 900;
  font-size: .88rem;
  line-height: 1;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.choice-chip:hover {
  transform: translateY(-1px);
  border-color: var(--purple-pale);
  color: var(--purple-dark);
  background: #fff;
}
.choice-chip.active {
  color: white;
  background: linear-gradient(135deg, #8f84ff, #b9adff);
  box-shadow: 0 10px 22px rgba(143,132,255,.24);
}
.form-chips {
  padding-top: 2px;
}
.form-chips .choice-chip {
  flex: 1 1 auto;
  min-width: 72px;
  padding: 11px 13px;
  text-align: center;
}
.community-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 18px;
  background: var(--surface);
  border: 1px solid #f0edf8;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(57, 35, 118, .045);
}
.community-tabs button {
  position: relative;
  min-height: 56px;
  border: 0;
  background: white;
  color: #a19ba9;
  font-weight: 900;
  transition: color .18s ease, background .18s ease;
}
.community-tabs button.active {
  color: var(--purple);
  background: linear-gradient(180deg, #fff, #fbfaff);
}
.community-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--purple);
}
.community-view .toolbar {
  grid-template-columns: 1fr;
}
.community-view #postCategory {
  display: none;
}
.toolbar input, .toolbar select, .field input, .field select, .field textarea, #commentBody {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: white;
  color: var(--ink);
  outline: none;
}
.toolbar input:focus, .field input:focus, .field textarea:focus, #commentBody:focus { border-color: var(--purple); }

.card-grid, .list-grid, .creator-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.creator-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .post-card, .creator-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 10px 28px rgba(57,35,118,.06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  animation: cardIn .4s ease both;
}
.card:hover, .post-card:hover, .creator-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple-pale);
  box-shadow: 0 18px 40px rgba(57,35,118,.12);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-img {
  min-height: 180px;
  position: relative;
  display: grid;
  place-items: end start;
  padding: 12px;
  background: linear-gradient(135deg, #f2efff, #fff1f8) center/cover;
  transition: transform .3s ease, filter .3s ease;
}
.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.02) 22%, rgba(28,16,48,.48));
}
.card-img .badge {
  position: relative;
  z-index: 1;
}
.card:hover .card-img {
  filter: saturate(1.06);
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255,255,255,.92);
  color: var(--purple-dark);
  font-size: .78rem;
  font-weight: 900;
}
.card-body { padding: 14px; }
.card-body h3 { margin-bottom: 8px; font-size: 1rem; }
.meta { color: var(--muted); font-size: .88rem; }
.price { color: var(--purple-dark); font-size: 1.2rem; font-weight: 900; margin-top: 10px; }
.trade-open {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  display: block;
}
.status-badge {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(5,150,105,.92);
  color: white;
  font-size: .78rem;
  font-weight: 900;
}
.status-badge.hold { background: rgba(234,179,8,.94); color: #3f3000; }
.status-badge.done { background: rgba(126,119,140,.94); }
.trade-footline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.heart-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
}
.heart-btn.active {
  border-color: #f7a7d1;
  background: #fff0f7;
  color: #e95b9f;
}
.trade-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.detail-page-view {
  max-width: 1120px;
  margin: 0 auto;
}
.detail-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.detail-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.trade-detail-page,
.creator-detail-page {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}
.detail-gallery,
.detail-info-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 36px rgba(57,35,118,.08);
  overflow: hidden;
}
.detail-gallery {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.detail-gallery img,
.creator-hero-image {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  border-radius: 18px;
  background: var(--purple-soft);
}
.detail-info-panel {
  padding: clamp(18px, 3vw, 28px);
}
.detail-info-panel h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.75rem, 3.4vw, 2.7rem);
}
.price.xl {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  margin: 8px 0 14px;
}
.payment-ready-box {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #e6ddff;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(244,241,255,.96), rgba(255,248,252,.95));
}
.payment-ready-box strong {
  font-size: 1rem;
}
.payment-ready-box p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.creator-detail-page .detail-samples {
  padding: 10px;
}
.checkout-view,
.orders-view {
  max-width: 1120px;
  margin: 0 auto;
}
.checkout-shell {
  display: grid;
  grid-template-columns: minmax(300px, .92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}
.checkout-summary,
.checkout-form,
.checkout-empty,
.order-pipeline,
.order-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  box-shadow: 0 14px 36px rgba(57,35,118,.07);
}
.checkout-summary,
.checkout-form,
.checkout-empty {
  border-radius: 24px;
  padding: clamp(18px, 3vw, 26px);
}
.checkout-summary {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}
.checkout-summary img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  background: var(--purple-soft);
}
.checkout-summary h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.7vw, 2.25rem);
}
.checkout-form {
  display: grid;
  gap: 18px;
}
.checkout-steps {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.checkout-steps span {
  position: relative;
  padding: 10px 12px 10px 34px;
  border-radius: 13px;
  color: var(--muted);
  background: #faf8ff;
  font-weight: 900;
}
.checkout-steps span::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #d9d1ee;
}
.checkout-steps .done,
.checkout-steps .active {
  color: var(--purple-dark);
  background: var(--purple-soft);
}
.checkout-steps .done::before,
.checkout-steps .active::before {
  background: var(--purple);
  box-shadow: 0 0 0 5px rgba(143,132,255,.12);
}
.agreement-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e6ddff;
  border-radius: 16px;
  background: #fbf9ff;
}
.agreement-card input {
  margin-top: 5px;
  accent-color: var(--purple);
}
.agreement-card strong,
.agreement-card small {
  display: block;
}
.agreement-card small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}
.order-pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  border-radius: 22px;
  padding: 14px;
}
.order-pipeline div {
  padding: 14px;
  border-radius: 16px;
  background: var(--purple-soft);
}
.order-pipeline strong {
  display: block;
  font-size: 1.6rem;
  color: var(--purple-dark);
}
.order-pipeline span {
  color: var(--muted);
  font-weight: 900;
}
.orders-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.order-list {
  display: grid;
  gap: 12px;
}
.order-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  border-radius: 20px;
  padding: 12px;
}
.order-card > img {
  width: 100%;
  height: 126px;
  object-fit: cover;
  border-radius: 15px;
  background: var(--purple-soft);
}
.order-card-main {
  min-width: 0;
}
.order-card h3 {
  margin: 4px 0;
  font-size: 1rem;
}
.order-card .price {
  margin: 0 0 5px;
}
.order-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.order-actions button {
  flex: 1 1 auto;
}
.chat-view {
  max-width: 1120px;
  margin: 0 auto;
}
.chat-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  min-height: 620px;
}
.chat-room-list,
.chat-thread {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 36px rgba(57,35,118,.07);
  overflow: hidden;
}
.chat-room-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
}
.chat-room {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 10px;
  background: transparent;
  text-align: left;
}
.chat-room.active,
.chat-room:hover {
  background: var(--purple-soft);
  border-color: var(--purple-pale);
}
.chat-room img,
.chat-thread-head img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 16px;
}
.chat-room small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}
.chat-thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.chat-thread-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.chat-thread-head h2 {
  margin-bottom: 3px;
  font-size: 1.1rem;
}
.chat-messages {
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(244,241,255,.38), rgba(255,251,254,.72));
}
.chat-message {
  max-width: min(72%, 520px);
  justify-self: start;
}
.chat-message.mine {
  justify-self: end;
}
.chat-message span {
  display: block;
  margin: 0 8px 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}
.chat-message p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(57,35,118,.06);
}
.chat-message.mine p {
  color: white;
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, #8f84ff, #b9adff);
}
.chat-attachment {
  display: block;
  margin-top: 7px;
  color: inherit;
  text-decoration: none;
}
.chat-attachment.image img {
  width: min(260px, 100%);
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(57,35,118,.12);
}
.chat-attachment.file {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 22px rgba(57,35,118,.06);
}
.chat-attachment.file span {
  margin: 3px 0 0;
}
.chat-compose {
  --chat-control-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: white;
}
.chat-compose-main {
  display: grid;
  gap: 8px;
}
.chat-compose textarea {
  width: 100%;
  height: var(--chat-control-height);
  min-height: var(--chat-control-height);
  max-height: var(--chat-control-height);
  box-sizing: border-box;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  outline: none;
}
.attach-btn {
  display: grid;
  place-items: center;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: var(--chat-control-height);
  min-width: var(--chat-control-height);
  height: var(--chat-control-height);
  padding: 0;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 900;
  cursor: pointer;
}
.chat-compose > .primary-btn {
  align-self: end;
  height: var(--chat-control-height);
  min-height: var(--chat-control-height);
  padding-block: 0;
}
.attach-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.attachment-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px dashed var(--purple-pale);
  border-radius: 14px;
  background: #fbf9ff;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 800;
}
.chat-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 280px;
  padding: 22px;
  text-align: center;
}
.chat-empty.compact {
  min-height: 160px;
  color: var(--muted);
  font-weight: 800;
}
.floating-chat {
  position: fixed;
  right: clamp(16px, 4vw, 34px);
  bottom: clamp(18px, 4vw, 34px);
  z-index: 32;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #8f84ff, #f7a7d1);
  box-shadow: 0 16px 36px rgba(143,132,255,.3);
}
.trade-detail-grid > div,
.seller-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.trade-detail-grid span,
.trade-detail-grid strong {
  display: block;
}
.seller-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.status-row,
.inline-form {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}
.status-row {
  grid-template-columns: repeat(3, 1fr);
}
.stack { display: grid; gap: 12px; }
.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}
.mini-row strong { display: block; margin-bottom: 4px; }

.creator-card { padding: 16px; }
.creator-avatar {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  object-fit: cover;
  background: #ede9fe;
}
.creator-top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sample-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.sample-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag { border-radius: 999px; background: #f3f0f8; color: var(--muted); padding: 5px 8px; font-size: .78rem; font-weight: 800; }

.mypage-profile-head,
.profile-photo-editor {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mypage-profile-head h2,
.mypage-profile-head p { margin: 0; }
.profile-avatar {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 1.6rem;
  font-weight: 900;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-editor > div:last-child { display: grid; gap: 8px; min-width: 0; }
.profile-photo-editor input { width: 100%; }
.profile-photo-editor small { color: var(--muted); }

.post-list { display: grid; gap: 14px; }
.post-card { padding: 0; }
.post-card button {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: stretch;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}
.post-card:not(.with-image) button { grid-template-columns: 1fr; }
.post-summary { padding: 18px; min-width: 0; }
.post-card.text-only .post-summary { padding: 20px 22px; }
.post-card h3 { margin-bottom: 8px; }
.post-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .88rem; margin-top: 12px; }
.post-thumb {
  width: 100%;
  height: 100%;
  min-height: 144px;
  object-fit: cover;
  background: var(--purple-soft);
  transition: transform .3s ease, filter .3s ease;
}
.post-card:hover .post-thumb { filter: saturate(1.06); }
.post-card.default-image .post-thumb {
  opacity: .88;
}

.composer-panel {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--purple-pale);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,248,255,.96)),
    var(--surface);
  box-shadow: 0 14px 34px rgba(57,35,118,.09);
  animation: pageIn .24s ease both;
}
.composer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.composer-head h2 { margin-bottom: 4px; font-size: 1.25rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.wide-field {
  grid-column: 1 / -1;
}
.trade-editor {
  margin: 20px 0 18px;
  border: 1px solid rgba(222,215,255,.9);
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,248,255,.96)),
    var(--surface);
  box-shadow: 0 24px 60px rgba(69, 50, 130, .14);
  animation: pageIn .24s ease both;
}
.trade-editor-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
  color: white;
  background:
    linear-gradient(100deg, rgba(72,54,130,.86), rgba(143,132,255,.62), rgba(255,255,255,.08)),
    url("assets/images/hero-ai-cosphere.png") center 40% / cover;
}
.trade-editor-hero h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}
.trade-editor-hero p {
  max-width: 560px;
  color: rgba(255,255,255,.86);
  font-weight: 800;
}
.trade-editor-hero .light-btn {
  flex: 0 0 auto;
  color: #6d62df;
  box-shadow: 0 10px 24px rgba(41,29,89,.18);
}
.trade-editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
  gap: 18px;
  padding: clamp(16px, 3vw, 24px);
}
.trade-media-panel,
.trade-detail-panel,
.editor-section {
  min-width: 0;
}
.trade-media-panel {
  align-self: start;
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #faf8ff);
}
.trade-detail-panel {
  display: grid;
  gap: 14px;
}
.editor-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
}
.editor-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.editor-section-title span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 900;
}
.editor-section-title strong {
  display: block;
  font-size: 1rem;
}
.editor-section-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
}
.trade-editor .field {
  margin-bottom: 14px;
}
.trade-editor .field label {
  color: #6f687e;
  font-size: .84rem;
}
.trade-editor input,
.trade-editor select,
.trade-editor textarea {
  background: #fff;
  border: 1px solid #e6e0f5;
  box-shadow: 0 7px 18px rgba(67, 49, 128, .045);
}
.trade-editor input:focus,
.trade-editor select:focus,
.trade-editor textarea:focus {
  outline: 3px solid rgba(143,132,255,.18);
  border-color: var(--purple);
}
.media-uploader {
  padding: 14px;
  border: 1px dashed #d8ccff;
  border-radius: 18px;
  background: #fbf9ff;
}
.media-uploader input[type="file"] {
  width: 100%;
  border: 0;
  padding: 12px;
  border-radius: 14px;
  background: white;
}
.trade-editor .body-image-preview img {
  max-height: 300px;
  border-radius: 18px;
}
.trade-editor .notice {
  background: #fff8f1;
}
.trade-editor .primary-btn.full {
  min-height: 52px;
  border-radius: 16px;
  font-size: 1rem;
}
.post-editor {
  margin: 20px 0 18px;
  border: 1px solid rgba(222,215,255,.9);
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(252,249,255,.96)),
    var(--surface);
  box-shadow: 0 24px 60px rgba(69, 50, 130, .13);
  animation: pageIn .24s ease both;
}
.post-editor-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
  color: white;
  background:
    linear-gradient(100deg, rgba(101,85,183,.88), rgba(247,167,209,.55), rgba(255,255,255,.1)),
    url("assets/images/original/feed_1_furina.jpg") center 42% / cover;
}
.post-editor-hero h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}
.post-editor-hero p {
  max-width: 560px;
  color: rgba(255,255,255,.88);
  font-weight: 800;
}
.post-editor-hero .light-btn {
  flex: 0 0 auto;
  color: #6d62df;
  box-shadow: 0 10px 24px rgba(41,29,89,.18);
}
.post-editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, .84fr) minmax(0, 1.16fr);
  gap: 18px;
  padding: clamp(16px, 3vw, 24px);
}
.post-media-panel {
  align-self: start;
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #fff9fd);
}
.post-writing-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.post-editor .field {
  margin-bottom: 14px;
}
.post-editor .field label {
  color: #6f687e;
  font-size: .84rem;
}
.post-editor input,
.post-editor select,
.post-editor textarea {
  background: #fff;
  border: 1px solid #e6e0f5;
  box-shadow: 0 7px 18px rgba(67, 49, 128, .045);
}
.post-editor input:focus,
.post-editor select:focus,
.post-editor textarea:focus {
  outline: 3px solid rgba(247,167,209,.22);
  border-color: var(--pink);
}
.post-editor .media-uploader {
  background: #fffbfe;
}
.post-editor .crop-stage {
  aspect-ratio: 1 / 1;
}
.writing-section textarea {
  min-height: 260px;
  line-height: 1.65;
}
.post-editor .primary-btn.full {
  min-height: 52px;
  border-radius: 16px;
  font-size: 1rem;
}
.image-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--purple-soft);
}
.crop-stage::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 12px;
  pointer-events: none;
}
.crop-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: transform .12s ease;
}
.preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.image-editor-controls {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #faf8ff;
  border: 1px solid var(--line);
}
.image-editor-controls label {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}
.image-editor-controls input[type="range"] {
  accent-color: var(--purple);
}
.body-image-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.body-image-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--purple-soft);
}
.detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--purple-soft);
}
.detail-image { margin-top: 16px; }
.detail-image.body-attach {
  margin-top: 0;
  margin-bottom: 18px;
}

.modal {
  width: min(460px, calc(100% - 28px));
  border: 0;
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: modalIn .22s ease both;
}
.modal[open] { display: block; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal.wide { width: min(720px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(12,8,20,.58); backdrop-filter: blur(4px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3f0f8; font-size: 1.4rem; }
.field { margin-bottom: 13px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 800; font-size: .9rem; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}
.check-row input { margin-top: 3px; }
.hidden { display: none; }
.form-message { min-height: 20px; color: var(--pink); font-size: .9rem; }
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 13px 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-size: .92rem;
  font-weight: 800;
}
.notice.compact {
  margin: 8px 0 12px;
  display: block;
}
.mail-list { margin-top: 16px; }
.mail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}
.mail-item strong { display: block; margin-bottom: 6px; }
.mail-item p { color: var(--muted); margin-bottom: 10px; }
.detail-body { white-space: pre-wrap; line-height: 1.7; margin: 22px 0; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 18px; }
.danger-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 900;
}
.soft-danger {
  color: #b45309;
  background: #fff7ed;
  border-color: #fed7aa;
}
.comment-box { border-top: 1px solid var(--line); padding-top: 18px; }
#commentForm { display: grid; gap: 10px; margin-top: 12px; }

.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.mobile-nav button {
  flex: 1;
  border: 0;
  position: relative;
  border-radius: 16px;
  padding: 10px 4px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  font-size: .78rem;
}
.mobile-nav button.active {
  background: var(--purple-soft);
  color: var(--purple-dark);
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: flex; overflow-x: auto; }
  .mobile-nav button { min-width: 58px; flex: 0 0 auto; }
  .hero, .two-col { grid-template-columns: 1fr; }
  .trade-detail-page, .creator-detail-page, .chat-shell, .checkout-shell, .orders-grid { grid-template-columns: 1fr; }
  .floating-chat { bottom: 90px; }
  .checkout-summary { position: static; }
  .trade-editor-layout { grid-template-columns: 1fr; }
  .trade-media-panel { position: static; }
  .post-editor-layout { grid-template-columns: 1fr; }
  .post-media-panel { position: static; }
  .card-grid, .list-grid, .creator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input { grid-column: 1 / -1; }
  .post-card button { grid-template-columns: 132px 1fr; }
  .trade-detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  main { width: 100%; padding: 12px 12px 86px; }
  .site-header { padding: 12px; }
  .session-label { display: none; }
  .hero { min-height: auto; border-radius: 22px; padding: 26px 20px; }
  .hero h1 { font-size: 2.2rem; }
  .content-band, .page-head, .mypage-card { padding: 16px; border-radius: 18px; }
  .detail-page-head { display: grid; }
  .detail-page-actions { justify-content: stretch; }
  .detail-page-actions > * { flex: 1; }
  .detail-info-panel, .detail-gallery, .chat-room-list, .chat-thread { border-radius: 18px; }
  .checkout-summary, .checkout-form, .checkout-empty, .order-pipeline, .order-card { border-radius: 18px; }
  .order-pipeline { grid-template-columns: 1fr; }
  .order-card { grid-template-columns: 96px 1fr; }
  .order-card > img { height: 104px; }
  .chat-shell { min-height: auto; }
  .chat-messages { min-height: 320px; }
  .chat-compose { grid-template-columns: 1fr; }
  .chat-message { max-width: 88%; }
  .floating-chat { right: 14px; padding: 12px 15px; }
  .card-grid, .list-grid, .creator-grid { gap: 10px; }
  .card-img { min-height: 140px; }
  .toolbar { grid-template-columns: 1fr; }
  .row-head { align-items: flex-start; }
  .form-grid, .status-row, .trade-detail-grid { grid-template-columns: 1fr; }
  .trade-editor { border-radius: 22px; }
  .trade-editor-hero { display: grid; }
  .trade-editor-layout { padding: 12px; gap: 12px; }
  .post-editor { border-radius: 22px; }
  .post-editor-hero { display: grid; }
  .post-editor-layout { padding: 12px; gap: 12px; }
  .trade-media-panel, .editor-section { border-radius: 18px; padding: 14px; }
  .post-media-panel { border-radius: 18px; padding: 14px; }
  .editor-section-title { align-items: flex-start; }
  .community-tabs button { min-height: 50px; font-size: .86rem; }
  .post-card button { grid-template-columns: 1fr; }
  .post-thumb { height: 190px; }
  .composer-head { display: grid; }
}
