:root {
  color-scheme: light;
  --ink: #20302b;
  --muted: #63736d;
  --paper: #f8f5ee;
  --card: #fffdf8;
  --sage: #9bb5a7;
  --deep-sage: #335b4c;
  --peach: #f4c8aa;
  --line: #dbe2dc;
  --shadow: 0 18px 45px rgb(36 57 49 / 10%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.55; }
a { color: inherit; }
.site-header { min-height: 76px; padding: 0 6vw; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgb(255 253 248 / 92%); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50% 50% 42% 58%; color: white; background: var(--deep-sage); font-family: Georgia, serif; font-size: 1.3rem; }
.market-label { padding-left: 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: .84rem; text-transform: uppercase; letter-spacing: .13em; }
.site-nav { display: flex; gap: 18px; margin-left: auto; font-size: .9rem; font-weight: 700; }
.site-nav a, .text-button { color: var(--deep-sage); }
main { width: min(1180px, 88vw); margin: 0 auto; }
.hero { padding: clamp(64px, 10vw, 120px) 0 52px; max-width: 860px; }
.eyebrow { margin: 0 0 12px; color: var(--deep-sage); font-size: .76rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.08; letter-spacing: -.025em; }
.hero h1 { margin: 0; max-width: 820px; font-size: clamp(2.8rem, 7vw, 5.8rem); }
.hero-copy { max-width: 670px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); }
.trust-note { display: flex; gap: 14px; align-items: flex-start; padding: 18px 22px; border: 1px solid #e6b994; border-radius: 14px; background: #fff4e9; }
.trust-note > span { flex: none; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--peach); font-weight: 800; }
.trust-note p { margin: 0; }
.browse { padding: 76px 0 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.status { color: var(--muted); }
.helper-text { margin: 4px 0 0; color: var(--muted); font-size: .84rem; font-weight: 500; }
.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.listing-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 3px 18px rgb(36 57 49 / 5%); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.listing-card:hover, .listing-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); outline: none; }
.photo-frame { display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #e5ece7, #f2eadd); color: var(--muted); }
.photo-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-photo { aspect-ratio: 4 / 3; }
.photo-placeholder { font-family: Georgia, serif; font-size: 1.2rem; }
.card-body { padding: 22px; }
.card-price { margin: 0; color: var(--deep-sage); font-weight: 800; }
.card-title { margin: 8px 0; font-size: 1.55rem; }
.card-condition { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.delivery { margin: 18px 0 0; color: var(--deep-sage); font-size: .84rem; font-weight: 700; }
.load-more-wrap { display: grid; place-items: center; margin-top: 40px; }
.button { padding: 12px 22px; border: 1px solid var(--deep-sage); border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .1s ease, box-shadow .1s ease, background-color .15s ease; }
.button.secondary { color: var(--deep-sage); background: transparent; }
.button:hover { color: white; background: var(--deep-sage); }
.button:disabled { cursor: not-allowed; opacity: .55; }
button:active, .button:active, button.is-pressed, .button.is-pressed { transform: translateY(2px) scale(.98); box-shadow: inset 0 2px 4px rgb(32 48 43 / 18%); }
.buy-link { display: inline-block; margin-top: 24px; color: white; background: var(--deep-sage); text-decoration: none; }
.detail { padding: 50px 0 110px; }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--deep-sage); font-weight: 700; text-decoration: none; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: clamp(36px, 7vw, 90px); align-items: start; }
.gallery { display: grid; gap: 14px; }
.detail-photo { min-height: 320px; aspect-ratio: 4 / 3; border-radius: 18px; }
.detail-copy { position: sticky; top: 30px; }
.detail-title { margin: 0; font-size: clamp(2.4rem, 5vw, 4.5rem); }
.detail-price { margin: 20px 0 10px; color: var(--deep-sage); font-size: 1.7rem; font-weight: 800; }
.badge { display: inline-block; padding: 7px 12px; border-radius: 999px; background: #e5eee9; }
.subheading { margin: 34px 0 10px; font-size: 1.35rem; }
.body-copy { margin: 0; color: var(--muted); white-space: pre-wrap; }
.detail-note { margin-top: 34px; padding: 18px; border-left: 4px solid var(--peach); background: #fff4e9; }
footer { padding: 30px 6vw; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; text-align: center; }
.seller { padding: 70px 0 110px; }
.seller h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.5rem); }
.seller-panel { margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 3px 18px rgb(36 57 49 / 5%); }
.seller-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.seller-panel h2 { margin: 0 0 20px; }
.onboarding-panel { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.onboarding-panel h2 { margin-bottom: 10px; }
.onboarding-actions, .listing-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.listing-actions a { text-decoration: none; }
.form-grid { display: grid; gap: 18px; }
.form-grid > label { display: grid; gap: 6px; font-weight: 700; }
input, textarea, select { width: 100%; padding: 11px 12px; border: 1px solid #b8c6be; border-radius: 9px; background: white; color: var(--ink); font: inherit; }
#profile-form { align-content: start; }
#profile-form input { max-width: 34rem; }
#profile-form .button { width: fit-content; padding: 10px 18px; }
textarea { min-height: 100px; resize: vertical; }
fieldset { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 9px; }
fieldset label { display: flex !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
fieldset input { width: auto; }
.panel-heading, .seller-listing, .photo-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 0; }
.text-button { border: 0; background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.seller-listing, .photo-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.seller-listing .listing-actions { justify-content: flex-end; }
.seller-listing .button { padding: 8px 14px; font-size: .88rem; }
#address-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.address-card { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; gap: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 16px rgb(36 57 49 / 6%); }
.address-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.address-card h3 { margin: 0; font-size: 1.35rem; }
.address-details { margin: 16px 0; color: var(--ink); line-height: 1.55; }
.address-default-badge, .address-purpose { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; color: var(--deep-sage); background: #edf4ef; font-size: .76rem; font-weight: 750; }
.address-default-badge { flex: none; }
.address-purposes { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.address-purposes-label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.address-purpose.is-default { color: white; background: var(--deep-sage); }
.address-card .listing-actions { justify-content: flex-start; padding-top: 16px; border-top: 1px solid var(--line); }
.address-card .address-action { padding: 8px 13px; font-size: .8rem; }
.order-dashboard-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.order-dashboard-tabs [aria-selected="true"] { color: white; background: var(--deep-sage); }
.order-history-list { display: grid; gap: 18px; margin: 20px 0; }
.order-history-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.order-history-card h3 { margin: 0; font-size: 1.35rem; }
.order-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 18px 0; }
.order-field { min-width: 0; }
.order-field dt { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.order-field dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.danger-action { color: #8a341f; }
.seller-listing:last-child, .photo-row:last-child { border-bottom: 0; }
#seller-listings { display: grid; gap: 18px; margin-top: 24px; }
#seller-listings > .listing-group { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 14px; background: white; }
#seller-listings > .listing-group > h3 { margin: 0; padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--deep-sage); background: #edf4ef; font-size: 1.2rem; }
#seller-listings > .listing-group > div { padding: 0 18px; }
#seller-listings > .listing-group > div > .status { padding: 14px 0; }
.seller-listing p, .photo-row p { margin: 3px 0; }
.state { color: var(--muted); font-size: .84rem; text-transform: capitalize; }
.photo-advice { padding: 18px; border-radius: 12px; background: #edf4ef; }
.photo-advice ul { margin-bottom: 0; padding-left: 22px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.field-label { display: block; font-weight: 700; }
.condition-field { display: grid; gap: 6px; }
.condition-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 15px; border: 1px solid #b8c6be; border-radius: 9px; color: var(--ink); background: white; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.condition-trigger:hover, .condition-trigger:focus-visible { border-color: var(--deep-sage); outline: 2px solid rgb(51 91 76 / 18%); }
.photo-manager { display: grid; gap: 12px; padding-top: 4px; }
.photo-manager-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.photo-manager-heading p { margin-top: 2px; }
.photo-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-editor-tile, .photo-add-tile { position: relative; min-height: 112px; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #f1f3f1; }
.photo-editor-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-add-tile { display: grid; place-items: center; align-content: center; gap: 3px; border: 2px dashed #aebdb5; color: var(--deep-sage); font-size: .84rem; cursor: pointer; }
.photo-add-tile:hover { border-color: var(--deep-sage); background: #edf4ef; }
.photo-add-icon { font-size: 1.7rem; line-height: 1; }
.main-photo-badge { position: absolute; bottom: 7px; left: 7px; padding: 3px 8px; border-radius: 999px; color: white; background: rgb(32 48 43 / 84%); font-size: .7rem; font-weight: 700; }
.photo-tile-actions { position: absolute; z-index: 1; top: 6px; left: 6px; display: flex; gap: 4px; }
.photo-order-button, .photo-remove { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: white; background: rgb(32 48 43 / 82%); cursor: pointer; }
.photo-remove { position: absolute; z-index: 1; top: 6px; right: 6px; font-size: 1.15rem; }
.photo-tile-placeholder { display: grid; height: 100%; place-items: center; color: var(--muted); font-size: .8rem; }
.photo-status-list { display: grid; gap: 4px; }
.photo-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
.photo-status-row p { margin: 0; }
.compact-dialog { width: min(520px, 92vw); }
.dialog-close { float: right; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #edf1ee; font-size: 1.35rem; cursor: pointer; }
.condition-options { display: grid; gap: 10px; margin-top: 20px; }
.condition-options label { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.condition-options label:has(input:checked) { border-color: var(--deep-sage); background: #edf4ef; box-shadow: 0 0 0 1px var(--deep-sage); }
.condition-options input { width: auto; margin-top: 5px; }
.condition-options span { display: grid; gap: 3px; }
.condition-options small { color: var(--muted); font-weight: 400; }
.conflict-panel { padding: 20px; border: 2px solid #a85c32; border-radius: 12px; background: #fff4e9; }
.conflict-panel h3 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; }
.comparison-list { display: grid; gap: 10px; margin: 18px 0; }
.comparison-row { display: grid; grid-template-columns: minmax(110px, .55fr) 1fr 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.comparison-row strong { color: var(--deep-sage); }
.comparison-value { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comparison-value span { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.review-dialog { width: min(760px, 92vw); max-height: 88vh; overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.review-dialog::backdrop { background: rgb(32 48 43 / 55%); }
.review-dialog h2 { margin: 0; font-size: 2rem; }
.dialog-actions { justify-content: flex-end; margin-top: 22px; }
.buyer .seller-layout { align-items: start; }
#buyer-summary { margin-bottom: 24px; }
#payment-element { min-height: 180px; }
.site-notification { position: fixed; z-index: 1000; top: 92px; right: max(18px, 4vw); display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; width: min(460px, calc(100vw - 36px)); padding: 18px 20px; border: 2px solid var(--deep-sage); border-radius: 14px; color: var(--ink); background: #edf4ef; box-shadow: 0 18px 50px rgb(32 48 43 / 24%); }
.site-notification[hidden] { display: none; }
.site-notification[data-tone="error"] { border-color: #a33f2c; background: #fff0eb; }
.site-notification p { margin: 0; font-weight: 700; }
.notification-close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: inherit; background: rgb(255 255 255 / 70%); font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }

@media (max-width: 850px) {
  main { width: min(92vw, 680px); }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .seller-layout { grid-template-columns: 1fr; }
  .detail-copy { position: static; }
  .onboarding-panel { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
  .site-header { padding: 0 4vw; }
  .market-label { display: none; }
  .site-header { flex-wrap: wrap; padding-block: 12px; }
  .site-nav { width: 100%; margin-left: 46px; }
  .section-heading { align-items: start; flex-direction: column; }
  .listing-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 54px; }
  .detail-photo { min-height: 0; }
  .photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comparison-row { grid-template-columns: 1fr; }
  .address-card { grid-template-columns: 1fr; }
  #address-list { grid-template-columns: 1fr; }
  .order-fields { grid-template-columns: 1fr; }
  .address-card .listing-actions { justify-content: flex-start; }
  .seller-listing { align-items: flex-start; flex-direction: column; }
  .seller-listing .listing-actions { justify-content: flex-start; }
}

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