.subpage {
  --sp-ink: #171526;
  --sp-muted: #625e73;
  --sp-brand: #5b3df5;
  --sp-brand-hover: #472bd6;
  --sp-lavender: #f0ecff;
  --sp-line: #e9e6f0;
  --sp-soft: #f7f6fa;
  --sp-danger: #a82542;
  width: 100%;
  margin: 0 auto;
  padding: 36px 0 72px;
  color: var(--sp-ink);
}

.subpage *, .subpage *::before, .subpage *::after { box-sizing: border-box; }
.subpage [hidden] { display: none !important; }
.subpage h1, .subpage h2, .subpage p { margin: 0; }
.subpage a { color: inherit; text-decoration: none; }
.subpage button { font: inherit; cursor: pointer; }
.subpage button:disabled { cursor: wait; opacity: .65; }
.subpage :is(a, button, input, select, textarea):focus-visible { outline: 3px solid #9a86ff; outline-offset: 3px; }
.subpage h1 { font-size: clamp(1.9rem, 4vw, 2.65rem); line-height: 1.12; letter-spacing: -.045em; }
.subpage h2 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.018em; }

.sp-card {
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: 18px;
}

.subpage .sp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--sp-brand);
  color: #fff;
  font-size: .9375rem;
  font-weight: 680;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.subpage .sp-button:hover { background: var(--sp-brand-hover); }
.subpage .sp-button--muted { background: #fff; border-color: var(--sp-line); color: var(--sp-ink); }
.subpage .sp-button--muted:hover { background: var(--sp-soft); border-color: #d9d3e6; }
.subpage .sp-button--danger { background: #fff; border-color: #f0dbe0; color: var(--sp-danger); }
.subpage .sp-button--danger:hover { background: #fff4f6; border-color: #e8bac5; }
.sp-full { width: 100%; }

.sp-back, .sp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--sp-muted);
  font-size: .875rem;
  font-weight: 630;
}

.subpage .sp-back { display: inline-flex; width: fit-content; color: var(--sp-muted); margin-bottom: 24px; }
.subpage .sp-back:hover, .sp-breadcrumb a:hover { color: var(--sp-brand); }
.sp-breadcrumb { margin-bottom: 20px; }
.sp-breadcrumb svg { color: #91899e; }

.sp-centered { min-height: min(610px, 75vh); display: grid; align-items: start; justify-items: center; padding-top: 58px; }
.sp-auth { width: min(100%, 465px); padding: 34px; box-shadow: 0 12px 40px #2518470a; }
.sp-auth h1 { margin-top: 17px; font-size: clamp(1.9rem, 4vw, 2.25rem); }
.sp-auth p:not(.sp-error, .sp-field-note) { margin-top: 8px; color: var(--sp-muted); line-height: 1.55; }
.sp-auth > .sp-button, .sp-auth form { margin-top: 25px; }
.sp-auth h1, .sp-auth-heading > p { text-wrap: pretty; }
.sp-auth .sp-auth-switch { padding-top: 15px; font-size: .9rem; text-align: center; }
.sp-auth-switch a { color: var(--sp-brand); font-weight: 700; }
.sp-auth-switch a:hover { text-decoration: underline; }

.sp-tile-icon, .sp-avatar {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--sp-lavender);
  color: #5134de;
  flex: 0 0 auto;
}

.sp-message { display: grid; justify-items: center; padding: 44px 28px; text-align: center; }
.sp-message .sp-tile-icon { margin-bottom: 15px; }
.sp-message h1 { font-size: clamp(1.75rem, 3vw, 2.3rem); }
.sp-message p { margin-top: 9px; color: var(--sp-muted); line-height: 1.6; }
.sp-message .sp-button { margin-top: 21px; }

.sp-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(300px, 1fr);
  align-items: start;
  gap: clamp(22px, 4vw, 48px);
}

.sp-detail-media { grid-area: 1 / 1; }

.sp-photo-main {
  position: relative;
  aspect-ratio: 1.52;
  overflow: hidden;
  border: 1px solid var(--sp-line);
  border-radius: 18px;
  background: #f0eef4;
}

.sp-photo-main > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sp-placeholder { display: grid; width: 100%; height: 100%; place-items: center; background: #f0eef4; color: #857d94; }
.sp-gallery-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  border: 1px solid #e1dce9;
  border-radius: 50%;
  background: #fff;
  color: var(--sp-ink);
  box-shadow: 0 2px 10px #16142610;
}

.sp-gallery-arrow--before { left: 11px; }
.sp-gallery-arrow--before svg { transform: rotate(180deg); }
.sp-gallery-arrow--after { right: 11px; }
.sp-gallery-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 20px;
  padding: 5px 10px;
  background: #171526d9;
  color: #fff;
  font-size: .8125rem;
  font-weight: 650;
}

.sp-gallery-thumbs { display: flex; gap: 10px; padding: 9px 3px 4px; overflow: auto; }
.sp-thumbnail { width: 78px; height: 62px; padding: 2px; flex: 0 0 auto; border: 2px solid transparent; border-radius: 11px; background: transparent; }
.sp-thumbnail[aria-pressed="true"] { border-color: var(--sp-brand); }
.sp-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.sp-description { margin-top: 27px; padding: 23px 0 0; border-top: 1px solid var(--sp-line); }
.sp-description p { margin-top: 12px; color: #413b51; font-size: 1rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-detail-aside { display: grid; grid-area: 1 / 2; gap: 15px; }
.sp-detail-summary, .sp-seller { padding: 22px; }
.sp-detail-price-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-detail-price { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 780; line-height: 1; letter-spacing: -.045em; }
.sp-detail-summary h1 { margin-top: 16px; font-size: clamp(1.42rem, 3vw, 2.1rem); line-height: 1.2; overflow-wrap: anywhere; }
.sp-detail-location { display: flex; align-items: center; gap: 7px; margin-top: 12px !important; color: var(--sp-muted); font-size: .9375rem; }
.sp-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 17px; color: var(--sp-muted); font-size: .875rem; }
.sp-condition, .sp-status { border-radius: 30px; padding: 4px 9px; background: var(--sp-soft); font-size: .8125rem; font-weight: 680; white-space: nowrap; }
.sp-icon-button { display: grid; place-items: center; min-width: 43px; min-height: 43px; border: 1px solid var(--sp-line); border-radius: 12px; background: #fff; color: var(--sp-ink); }
.sp-heart:hover, .sp-heart.is-saved { color: var(--sp-brand); background: var(--sp-lavender); border-color: #ddd5ff; }
.sp-heart.is-saved svg { fill: currentColor; }
.sp-seller-identity { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.sp-seller-identity h2 { font-size: 1rem; overflow-wrap: anywhere; }
.sp-seller-identity p { margin-top: 4px; color: var(--sp-muted); font-size: .875rem; }
.sp-avatar { width: 42px; height: 42px; border-radius: 50%; font-weight: 760; }
.sp-contact-note { margin-top: 11px !important; color: var(--sp-muted); font-size: .875rem; line-height: 1.5; }
.sp-contact { display: grid; gap: 8px; color: var(--sp-muted); line-height: 1.5; }
.sp-contact a { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 8px 11px; border-radius: 9px; background: var(--sp-lavender); color: #5134de; font-weight: 650; overflow-wrap: anywhere; }
.sp-contact a:hover { text-decoration: underline; }
.sp-contact a svg, .sp-detail-location svg { flex: 0 0 auto; }
.sp-contact-address { display: flex; align-items: start; gap: 9px; padding: 9px 11px; border: 1px solid var(--sp-line); border-radius: 9px; color: var(--sp-ink); overflow-wrap: anywhere; }
.sp-contact-address svg { margin-top: 2px; color: var(--sp-brand); }
.sp-contact-address strong { display: block; margin-bottom: 2px; font-size: .875rem; }

.sp-account-nav { display: flex; gap: 5px; padding-bottom: 15px; border-bottom: 1px solid var(--sp-line); overflow-x: auto; }
.sp-account-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 43px; padding: 9px 13px; border-radius: 9px; color: var(--sp-muted); font-size: .9375rem; font-weight: 650; white-space: nowrap; }
.sp-account-nav a:hover { background: var(--sp-soft); color: var(--sp-ink); }
.sp-account-nav a.is-current { background: var(--sp-lavender); color: #5134de; }
.sp-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 22px; }
.sp-heading-row p, .sp-editor-section p:not(.sp-error) { margin-top: 7px; color: var(--sp-muted); line-height: 1.55; }
.sp-management { overflow: hidden; }
.sp-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px; border-bottom: 1px solid var(--sp-line); }
.sp-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 9px; border: 0; border-radius: 9px; background: transparent; color: var(--sp-muted); font-size: .875rem !important; font-weight: 680 !important; white-space: nowrap; }
.sp-filter:hover { background: var(--sp-soft); }
.sp-filter[aria-pressed="true"] { background: var(--sp-lavender); color: #5134de; }
.sp-filter span { color: inherit; font-size: .8125rem; }

.sp-management-row {
  display: grid;
  align-items: center;
  grid-template-columns: 78px minmax(150px, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--sp-line);
}

.sp-management-row:last-of-type { border-bottom: 0; }
.sp-management-photo { width: 78px; height: 60px; overflow: hidden; border-radius: 9px; }
.sp-management-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-management-photo .sp-placeholder svg { width: 23px; height: 23px; }
.sp-management-title { display: block; font-weight: 720; line-height: 1.3; overflow-wrap: anywhere; }
a.sp-management-title:hover { color: var(--sp-brand); }
.sp-management-copy > p:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-top: 5px; color: var(--sp-muted); font-size: .875rem; }
.sp-management-copy strong { color: var(--sp-ink); }
.sp-management-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-management .sp-management-actions .sp-button { min-height: 37px; padding: 6px 9px; border-radius: 8px; font-size: .875rem; }
.sp-status--active { background: #eaf8ee; color: #225e38; }
.sp-status--sold { background: #eaf1fb; color: #285182; }
.sp-status--hidden { background: #fff1f3; color: var(--sp-danger); }
.sp-filter-empty { padding: 22px 14px; color: var(--sp-muted); text-align: center; }
.sp-management-error { margin: 12px 14px !important; }

.sp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sp-metric { display: grid; justify-items: start; gap: 7px; min-width: 0; padding: 14px; }
.sp-metric .sp-tile-icon { width: 41px; height: 41px; border-radius: 11px; margin-bottom: 2px; }
.sp-metric strong { font-size: 1.65rem; line-height: 1.1; letter-spacing: -.038em; }
.sp-metric > span:last-child { color: var(--sp-muted); font-size: .875rem; }
.sp-section-heading { margin: 26px 0 11px !important; }
.sp-settings { display: grid; gap: 15px; padding: 16px; }
.sp-setting { display: flex; align-items: start; gap: 12px; width: fit-content; cursor: pointer; }
.sp-setting input { flex: 0 0 auto; width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--sp-brand); cursor: pointer; }
.sp-setting strong { display: block; font-size: .9375rem; }
.sp-setting small { display: block; margin-top: 4px; color: var(--sp-muted); font-size: .875rem; line-height: 1.45; }
.sp-settings-actions { display: flex; justify-content: start; }
.sp-member-error { margin-bottom: 8px !important; }
.sp-user-list { overflow: auto; }
.sp-user-list table { width: 100%; border-collapse: collapse; text-align: left; }
.sp-user-list :is(th, td) { padding: 11px 14px; border-bottom: 1px solid var(--sp-line); font-size: .9rem; overflow-wrap: anywhere; }
.sp-user-list th { background: var(--sp-soft); font-weight: 700; }
.sp-user-list tr:last-child td { border-bottom: 0; }
.sp-user-list .sp-button { min-height: 37px; padding: 6px 9px; border-radius: 8px; font-size: .875rem; }

.sp-form-page { width: min(750px, 100%); }
.sp-form { display: grid; gap: 16px; }
.sp-form-page .sp-heading-row { margin-top: 0; }
.sp-editor { gap: 0; padding: 0 25px; }
.sp-editor-section { display: grid; gap: 15px; padding: 23px 0; border-bottom: 1px solid var(--sp-line); }
.sp-editor-section p:not(.sp-error) { font-size: .9375rem; }
.sp-field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.sp-field { display: grid; align-content: start; gap: 6px; min-width: 0; font-size: .875rem; font-weight: 680; }
.sp-field :is(input, select, textarea) { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #ded9ea; border-radius: 9px; background: #fff; color: var(--sp-ink); font: inherit; font-size: 1rem; font-weight: 450; }
.sp-field :is(input, textarea)::placeholder { color: #766f87; }
.sp-field select {
  appearance: none;
  padding-right: 33px;
  background-image: linear-gradient(45deg, transparent 50%, var(--sp-muted) 50%), linear-gradient(135deg, var(--sp-muted) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.sp-field textarea { resize: vertical; line-height: 1.5; }
.sp-field-note { margin-top: -10px !important; color: var(--sp-muted); font-size: .8125rem; }
.sp-editor-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 9px; padding: 19px 0 23px; }
.sp-editor > .sp-error { margin-top: 14px; }
.sp-error { padding: 9px 11px; border-radius: 8px; background: #fff2f4; color: var(--sp-danger); font-size: .875rem; line-height: 1.45; }

.sp-upload { border: 1px dashed #c8bbf6; border-radius: 12px; background: #faf8ff; }
.sp-upload:hover, .sp-upload.is-dragging { background: var(--sp-lavender); border-color: var(--sp-brand); }
.sp-upload:focus-within { outline: 3px solid #9a86ff; outline-offset: 3px; }
.sp-upload-label { position: relative; display: flex; align-items: center; gap: 12px; min-height: 77px; padding: 12px 16px; color: #5134de; }
.sp-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sp-upload-label strong, .sp-upload-label small { display: block; }
.sp-upload-label small { margin-top: 4px; color: var(--sp-muted); font-size: .8125rem; }
.sp-photo-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.sp-preview { position: relative; height: 118px; overflow: hidden; border: 1px solid var(--sp-line); border-radius: 10px; background: var(--sp-soft); }
.sp-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-remove-photo { position: absolute; top: 5px; right: 5px; display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; background: #fff; color: var(--sp-ink); box-shadow: 0 1px 7px #1614262b; }
.sp-cover-label { position: absolute; bottom: 5px; left: 5px; max-width: calc(100% - 10px); padding: 5px 7px; border: 0; border-radius: 6px; background: #5b3df5; color: #fff; font-size: .8125rem !important; font-weight: 680 !important; }
.sp-cover-label--action { background: #fff; color: var(--sp-ink); }
.sp-cover-label--action:hover, .sp-remove-photo:hover { background: var(--sp-lavender); }

@media (max-width: 760px) {
  .subpage { padding: 24px 0 52px; }
  .sp-centered { padding-top: 35px; }
  .sp-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .sp-detail-media { display: contents; }
  .sp-gallery { grid-area: 1 / 1; }
  .sp-detail-aside { grid-area: 2 / 1; }
  .sp-description { grid-area: 3 / 1; margin-top: 0; padding-top: 17px; }
  .sp-management-row { grid-template-columns: 67px minmax(0, 1fr); }
  .sp-management-photo { width: 67px; height: 54px; }
  .sp-management-actions { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .sp-auth, .sp-detail-summary, .sp-seller { padding: 18px; }
  .sp-heading-row { align-items: start; flex-direction: column; }
  .sp-form-page .sp-heading-row { margin-bottom: 16px; }
  .sp-editor { padding: 0 14px; }
  .sp-editor-section { padding: 17px 0; }
  .sp-field-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-photo-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-user-list :is(th, td) { padding: 8px; }
  .sp-user-list .sp-button { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .subpage *, .subpage *::before, .subpage *::after { transition: none !important; }
}
