:root {
  --ink: #17202a;
  --muted: #637083;
  --line: rgba(23, 32, 42, 0.12);
  --paper: #fffdf8;
  --good: #0f766e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: #f6f8fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

button,
input,
select,
textarea {
  font: inherit;
}

.sell-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.sell-hero {
  position: relative;
  margin-bottom: 18px;
  padding-right: 150px;
}

.sell-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--good);
  font-weight: 950;
  text-decoration: none;
}

.sell-brand::before {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: 0 0 auto;
  background:
    linear-gradient(rgba(5, 8, 20, 0.1), rgba(5, 8, 20, 0.1)),
    url("/assets/tcgportal-logo.jpg") center 32% / 180% auto no-repeat;
  box-shadow: 0 10px 24px rgba(25, 103, 210, 0.22);
}

.sell-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  line-height: 0.92;
}

.sell-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.market-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 12px;
  min-height: 34px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
}

.protection-panel,
.seller-payout-row,
.cart-protection {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #ecfdf5;
  color: #164e43;
}

.protection-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.price-alert-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.price-alert-form input {
  min-height: 42px;
}

.price-alert-form .sell-button {
  min-height: 42px;
  white-space: nowrap;
}

.price-alert-form.is-disabled {
  opacity: 0.55;
}

.price-alert-form.is-disabled input,
.price-alert-form.is-disabled button {
  pointer-events: none;
}

.seller-price-coach {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 850;
}

.seller-price-coach strong {
  color: #17202a;
  font-size: 0.9rem;
}

.seller-price-coach.good {
  border-color: rgba(15, 118, 110, 0.22);
  background: #ecfdf5;
  color: #0f766e;
}

.seller-price-coach.high {
  border-color: rgba(217, 119, 6, 0.25);
  background: #fffbeb;
  color: #92400e;
}

.seller-price-coach.low {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eff6ff;
  color: #1d4ed8;
}

#priceAlertStatus {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #34665d;
  font-size: 0.86rem;
  font-weight: 850;
}

.protection-panel strong,
.seller-payout-row strong,
.cart-protection strong {
  display: block;
}

.protection-panel p {
  margin: 4px 0 0;
  color: #34665d;
  line-height: 1.45;
}

.protection-panel span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 950;
}

.sell-hero-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.market-account-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  color: var(--good);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.market-cart-link {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--good);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.28);
  cursor: pointer;
}

.market-cart-link svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

#cartStatus a {
  color: var(--good);
  font-weight: 950;
}

.quick-actions {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(calc(100vw - 32px), 560px);
  padding: 6px;
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(14px);
}

.quick-actions:empty {
  display: none;
}

.quick-action-link,
.app-install-button,
.quick-actions .album-launcher,
.quick-actions .scanner-launcher {
  position: static;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--good);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.quick-actions .scanner-launcher {
  right: auto;
  bottom: auto;
  z-index: auto;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.is-installed-app .app-install-button {
  display: none;
}

.quick-action-cart svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.cart-added-prompt {
  position: fixed;
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 10002;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: min(380px, calc(100% - 36px));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 12px;
  color: #ffffff;
  background: #123d37;
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.24);
}

.cart-added-prompt.is-visible {
  display: flex;
}

.cart-added-prompt span {
  flex: 1;
  font-weight: 850;
}

.cart-added-prompt button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--good);
  background: #ffffff;
  font-weight: 950;
  cursor: pointer;
}

.cart-added-prompt button:last-child {
  width: 34px;
  padding: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.sell-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 22px 70px rgba(17, 24, 39, 0.12);
  scroll-margin-top: 22px;
}

.sell-panel.is-editing {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 22px 70px rgba(15, 118, 110, 0.16);
}

.market-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 18px 54px rgba(17, 24, 39, 0.08);
}

.market-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.market-eyebrow {
  margin: 0 0 7px;
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-head h2 {
  margin: 0 0 4px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.market-head p {
  margin: 0;
  color: var(--muted);
}

.market-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.market-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(150px, 190px);
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.stripe-setup-link:not([hidden]) {
  color: #ffffff;
  background: #b91c1c;
  text-decoration: none;
}

.cart-button span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--good);
  color: #ffffff;
  font-size: 0.78rem;
}

.sell-account {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.seller-payout-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 14px 16px;
  padding: 14px;
}

.seller-payout-row span {
  display: block;
  margin-top: 3px;
  color: #34665d;
  font-size: 0.9rem;
}

.seller-referral-code {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffffff;
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 950;
}

.profile-settings {
  margin: 0 16px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.profile-settings summary {
  min-height: 44px;
  padding: 11px 14px;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.profile-settings-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.notification-toggle {
  display: inline-flex;
  width: fit-content;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: #ecfdf5;
  color: #164e43;
  font-size: 0.9rem;
  font-weight: 950;
}

.notification-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--good);
}

.sell-form {
  display: grid;
}

.sell-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--good);
  color: #ffffff;
  font-weight: 950;
}

.step-content {
  display: grid;
  gap: 12px;
}

.step-content h2 {
  margin: 3px 0 0;
  font-size: 1.18rem;
}

.ai-populate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ai-populate-button {
  background: #0f766e;
}

.ai-populate-button[hidden] {
  display: none;
}

.ai-populate-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

#aiPopulateStatus {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.field-stack {
  display: grid;
  gap: 12px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 850;
}

.sr-label {
  color: transparent;
  font-size: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  padding-top: 11px;
  resize: vertical;
}

.photo-drop {
  display: grid;
  place-items: center;
  min-height: 136px;
  border: 2px dashed rgba(15, 118, 110, 0.35);
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--good);
  text-align: center;
  cursor: pointer;
}

.photo-drop input {
  display: none;
}

.photo-drop span {
  font-size: 1.05rem;
  font-weight: 950;
}

.photo-drop small {
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 9px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e5e7eb;
}

.optional-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.optional-details summary {
  color: var(--good);
  font-weight: 950;
  cursor: pointer;
}

.optional-details .mini-grid {
  margin-top: 12px;
}

.seller-confirmation {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 10px;
  padding: 12px;
  background: #ecfdf5;
  color: #164e43;
  line-height: 1.35;
}

.seller-confirmation input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--good);
}

.seller-confirmation span {
  font-size: 0.9rem;
}

.sell-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: #ffffff;
}

.sell-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--good);
  color: #ffffff;
  font-weight: 950;
  cursor: pointer;
}

.sell-button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.sell-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.sell-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.sell-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10001;
  max-width: min(360px, calc(100% - 36px));
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.22);
  font-weight: 950;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.sell-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sell-toast.is-error {
  background: #b91c1c;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.market-card {
  display: grid;
  grid-template-rows: 250px 1fr;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

.market-photo-wrap {
  width: 100%;
  height: 250px;
  border: 0;
  padding: 0;
  background: #e5e7eb;
  overflow: hidden;
}

.market-detail-link {
  cursor: pointer;
}

.market-detail-link:hover img,
.market-title-link:hover {
  filter: brightness(0.96);
}

.market-card img,
.market-photo-placeholder {
  width: 100%;
  height: 100%;
}

.market-card img {
  object-fit: contain;
  object-position: center;
  display: block;
  background: #f1f5f9;
}

.market-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 950;
}

.market-card-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 9px;
  padding: 12px;
}

.market-title-row {
  display: grid;
  gap: 6px;
}

.market-title-row h3,
.market-title-link {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.18;
}

.market-title-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 950;
  cursor: pointer;
  min-height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.market-title-row strong {
  white-space: nowrap;
  color: var(--good);
  font-size: 1.28rem;
}

.market-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.market-card-body > p:not(.market-description) {
  min-height: 1.45em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.market-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.market-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: #ffffff;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 900;
}

.market-seller-trust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.market-seller-trust span {
  color: #f59e0b;
  white-space: nowrap;
}

.market-seller-trust small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-description {
  font-size: 0.9rem;
  min-height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.market-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
}

.market-actions .sell-button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.market-actions .market-primary-action {
  grid-column: 1 / -1;
  font-size: 0.92rem;
}

.market-actions .market-detail-action {
  min-width: 74px;
  padding: 0 8px;
}

.market-owner-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 118, 110, 0.12);
}

.market-owner-actions .sell-button {
  min-height: 34px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.market-empty {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  min-height: 120px;
  border: 1px dashed rgba(23, 32, 42, 0.2);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
  gap: 6px;
  text-align: center;
  padding: 18px;
}

.market-empty strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.market-empty span {
  max-width: 520px;
  font-weight: 750;
}

.post-sale-fab {
  position: fixed;
  left: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9998;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--good);
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(15, 118, 110, 0.32);
}

.post-sale-fab span {
  display: block;
  transform: translateY(-1px);
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 900;
}

.message-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 18, 28, 0.62);
}

.message-modal.is-open {
  display: flex;
}

.message-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.trade-card {
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
}

.listing-detail-modal {
  align-items: stretch;
  overflow: auto;
}

.listing-detail-card {
  position: relative;
  width: min(1040px, 100%);
  max-height: none;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.detail-gallery {
  display: grid;
  gap: 10px;
}

.detail-main-photo {
  display: grid;
  place-items: center;
  min-height: 520px;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
}

.detail-main-photo img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #e5e7eb;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}

.detail-thumbs button {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #e5e7eb;
  cursor: pointer;
}

.detail-thumbs button.is-active {
  border-color: var(--good);
}

.detail-thumbs img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
}

.detail-info {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 26px;
}

.detail-info h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 0.98;
}

.detail-price {
  color: var(--good);
  font-size: 2rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
}

.detail-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.seller-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 10px;
  padding: 12px;
  background: #ecfdf5;
}

.seller-box span,
.seller-box small {
  display: block;
  color: #34665d;
  font-size: 0.82rem;
  font-weight: 850;
}

.seller-stars {
  color: #f59e0b;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.seller-rating {
  text-align: right;
}

.detail-price-history {
  display: grid;
  gap: 10px;
}

.detail-price-history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.detail-price-history-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.detail-price-history-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.detail-chart-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.detail-chart-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.detail-chart-meta span {
  border-radius: 999px;
  padding: 3px 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.detail-chart-meta strong {
  color: var(--ink);
}

.detail-chart-meta em {
  color: var(--good);
  font-style: normal;
  font-weight: 900;
}

.detail-chart-meta em.is-negative {
  color: #b91c1c;
}

.detail-chart-wrap {
  min-height: 250px;
}

.detail-history-svg {
  width: 100%;
  height: auto;
  display: block;
}

.detail-chart-axis {
  stroke: #d9e2ec;
  stroke-width: 1;
}

.detail-chart-bars rect {
  fill: #d8f0ff;
}

.detail-chart-line {
  fill: none;
  stroke: #1547ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-chart-dot {
  fill: #1547ff;
}

.detail-chart-labels text {
  fill: #6b7280;
  font-size: 13px;
  font-weight: 750;
}

.detail-chart-ranges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.detail-chart-ranges button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.detail-chart-ranges button.is-active {
  background: #111827;
  color: #ffffff;
}

.detail-chart-empty {
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px dashed rgba(23, 32, 42, 0.18);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.detail-chart-empty strong {
  color: var(--ink);
}

.detail-chart-empty p {
  margin: 0;
}

.detail-chart-empty a {
  color: var(--good);
  font-weight: 950;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.detail-actions .sell-button:first-child {
  grid-column: 1 / -1;
}

.message-card h2 {
  margin: 0 0 6px;
}

.message-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  justify-content: end;
  background: rgba(12, 18, 28, 0.48);
}

.cart-drawer.is-open {
  display: flex;
}

.cart-panel {
  width: min(460px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  box-shadow: -20px 0 70px rgba(17, 24, 39, 0.2);
}

.cart-head,
.cart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-head h2,
.cart-head p {
  margin: 0;
}

.cart-head p {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-close {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.cart-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.cart-protection {
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cart-protection span {
  display: block;
  margin-top: 4px;
  color: #34665d;
}

.cart-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--paper);
}

.cart-item img {
  width: 62px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #e5e7eb;
}

.cart-item strong,
.cart-item span,
.cart-item small {
  display: block;
}

.cart-item span,
.cart-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

.cart-item button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.cart-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.cart-foot strong {
  color: var(--good);
  font-size: 1.2rem;
}

@media (max-width: 640px) {
  .sell-shell {
    width: min(100% - 20px, 1120px);
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .sell-hero {
    padding-right: 0;
    padding-top: 52px;
  }

  .sell-hero-actions {
    left: 0;
    right: auto;
  }

  .market-account-link {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .market-cart-link {
    width: 42px;
    height: 42px;
  }

  .sell-step {
    grid-template-columns: 1fr;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .market-head {
    align-items: stretch;
    flex-direction: column;
  }

  .market-head-actions {
    justify-content: stretch;
  }

  .market-head-actions > * {
    flex: 1;
  }

  .protection-panel,
  .seller-payout-row {
    align-items: stretch;
    flex-direction: column;
  }

  .price-alert-form {
    grid-template-columns: 1fr;
  }

  .market-filter-bar {
    grid-template-columns: 1fr;
  }

  .market-card {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
  }

  .market-photo-wrap {
    height: 220px;
  }

  .listing-detail-card {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .detail-main-photo {
    min-height: 360px;
  }

  .detail-info {
    padding-right: 0;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .detail-actions .sell-button:first-child {
    grid-column: auto;
  }

  .cart-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .cart-item button {
    grid-column: 2;
    width: fit-content;
  }

  .cart-added-prompt {
    left: 14px;
    right: 14px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    max-width: none;
  }

  .post-sale-fab {
    left: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .quick-actions {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    justify-content: center;
    max-width: none;
  }

  .quick-action-link,
  .app-install-button,
  .quick-actions .album-launcher,
  .quick-actions .scanner-launcher {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
    font-size: 0.82rem;
  }
}
