:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --white: #fffefa;
  --ink: #0c1b25;
  --soft: #535c69;
  --line: #deddd6;
  --navy: #0c1b25;
  --accent: #ff5937;
  --accent-hover: #ff765a;
  --radius: 18px;
  font-family: "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #b93a21; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 11px; color: var(--ink);
  background: var(--accent); font-weight: 750; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: default; }
input:not([type=file]), select, textarea {
  min-height: 44px; padding: 9px 12px; border: 1px solid #aeb1b5;
  border-radius: 10px; background: var(--white); color: var(--ink);
}
.market { font-size: 16px; line-height: 1.55; }
.market h1, .market h2 { letter-spacing: -.035em; line-height: 1.07; }
.market h1 { font-size: clamp(34px, 5vw, 60px); margin: 0 0 24px; overflow-wrap: anywhere; }
.market h2 { font-size: clamp(23px, 3vw, 31px); margin: 0 0 16px; }
.market main, .site-header nav, .site-footer { width: min(1180px, 100% - 48px); margin: auto; }
.market main { padding: 32px 0 56px; min-height: 65vh; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header nav, .site-links, .site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; }
.site-header nav { justify-content: space-between; padding: 16px 0; }
.site-links a:not(.button), .site-footer a { font-weight: 650; text-decoration: none; }
.site-links a:not(.button):hover, .site-footer a:hover { text-decoration: underline; }
.account-nav { display: inline-flex; flex-direction: column; max-width: min(190px, 65vw); line-height: 1.2; }
.account-nav span { font-size: 12px; color: var(--soft); }
.account-nav strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-nav { position: relative; }
.message-badge {
  position: absolute; top: -13px; right: -10px; min-width: 18px; min-height: 18px; padding: 1px 4px;
  border-radius: 999px; background: #c5361d; color: #fff; text-align: center; font-size: 11px; line-height: 16px;
}
.message-badge[hidden] { display: none; }
.brand { display: inline-block; width: clamp(240px, 32vw, 340px); max-width: 100%; }
.brand img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.site-footer { color: var(--soft); border-top: 1px solid var(--line); padding: 22px 0 32px; font-size: 14px; }
.site-footer span { margin-right: auto; color: var(--ink); font-weight: 800; }
.market-hero {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(23px, 5vw, 54px);
  border-radius: 24px; background: var(--navy); color: #fff8ef;
}
.market-hero::before, .market-hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.market-hero::before { width: min(56vw, 700px); height: min(20vw, 250px); top: 15%; right: -8%;
  border-radius: 50%; border-top: clamp(8px, 2vw, 26px) solid #ff59374d; transform: rotate(-14deg); }
.market-hero::after { width: clamp(18px, 5vw, 60px); aspect-ratio: 1; border-radius: 50%;
  right: 10%; top: 13%; background: #ff593763; }
.market-hero h1 { max-width: 700px; font-weight: 900; }
.search-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 10px; }
.search-row input { width: 100%; }
.advanced { margin-top: 16px; }
.advanced summary { width: fit-content; cursor: pointer; font-size: 14px; font-weight: 700; color: #fff0dd; }
.advanced summary:focus-visible { outline-color: var(--accent); }
.filter-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.filter-options label { font-size: 13px; }
.filter-options select, .filter-options input { display: block; width: 100%; margin-top: 3px; }
.apply-filters { margin-top: 12px; }
.catalog-section { margin-top: 32px; }
.categories { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.categories a {
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 9px 11px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 13px; font-weight: 750;
  font-size: 14px; line-height: 1.25; text-decoration: none;
}
.categories a span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 8px; background: #f9e2d7; color: #71301a; font-size: 20px; }
.categories a:nth-child(3n + 2) span { background: #e2e9fa; color: #293b68; }
.categories a:nth-child(3n + 3) span { background: #e6ecd9; color: #3e522e; }
.categories a:hover, .categories a[aria-current] { border-color: #ba4b29; background: #fff2eb; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); gap: 16px; }
.card, .empty, .market .editor, .conversation article { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.card { padding: 16px; overflow-wrap: anywhere; }
.card h2 { font-size: 19px; margin: 0; }
.listing-card { overflow: hidden; padding: 0; transition: box-shadow .15s ease; }
.listing-card:hover { box-shadow: 0 8px 28px #151e3215; }
.card-copy { padding: 16px; }
.card-copy .price { margin: 0 0 6px; }
.card-copy .meta { margin: 8px 0 0; }
.presence { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; border-radius: 6px;
  color: var(--soft); background: #efeee9; white-space: nowrap; font-size: 12px; }
.presence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #767e88; }
.presence.online { color: #17502b; background: #e1f0e4; }
.presence.online::before { background: #258447; }
.listing-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 14px; }
.listing-actions .secondary { background: var(--white); border-color: var(--line); color: var(--ink); }
.listing-actions .secondary:hover, .listing-actions button[aria-pressed="true"] { background: #fff2eb; border-color: #ba4b29; }
.listing-card .listing-actions .secondary { padding-inline: 9px; font-size: 13px; }
.share-status { display: block; color: var(--soft); font-size: 13px; }
.share-link input { display: block; width: 100%; }
.card-media { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; background: #e9e6de; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { font-size: 54px; color: #7b6e63; }
.empty { padding: 20px; }
.empty p { margin-top: 0; }
.meta { color: var(--soft); }
.price { font-size: 25px; font-weight: 850; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 720px; }
.market .editor { width: min(100%, 660px); padding: clamp(14px, 4vw, 24px); }
.editor label { display: block; margin: 0 0 16px; font-weight: 700; }
.editor label[hidden], .filter-options label[hidden] { display: none; }
.editor input:not([type=file]), .editor select, .editor textarea { display: block; width: 100%; margin-top: 5px; }
.editor textarea { min-height: 140px; }
.listing-trail { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--soft); font-size: 14px; margin-bottom: 12px; }
.market .listing-title { max-width: 900px; font-size: clamp(30px, 4vw, 48px); margin-bottom: 22px; }
.listing-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  grid-template-areas: "gallery sidebar" "details sidebar"; gap: 24px 28px; align-items: start; }
.listing-detail.no-photo { grid-template-areas: "details sidebar"; }
.listing-gallery { grid-area: gallery; min-width: 0; }
.listing-main-photo { display: block; background: #e9e6de; border-radius: var(--radius); overflow: hidden; }
.listing-main-photo img { display: block; width: 100%; height: clamp(230px, 40vw, 510px); object-fit: contain; }
.listing-thumbnails { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.listing-thumbnails a { width: 65px; padding: 3px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.listing-thumbnails a[aria-current="true"] { border-color: #bd4a24; box-shadow: 0 0 0 1px #bd4a24; }
.listing-thumbnails img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.listing-sidebar { grid-area: sidebar; position: sticky; top: 16px; padding: 20px;
  background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.listing-sidebar .price { margin: 0 0 10px; font-size: clamp(28px, 4vw, 39px); line-height: 1.1; overflow-wrap: anywhere; }
.listing-sidebar .author-line { margin: 10px 0 18px; overflow-wrap: anywhere; }
.listing-sidebar > form button, .listing-sidebar > .button { width: 100%; }
.listing-details { grid-area: details; min-width: 0; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.listing-details section + section { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.listing-details h2 { font-size: 23px; }
.listing-details .description { margin: 0; }
.listing-stats { display: flex; flex-wrap: wrap; gap: 4px; margin: 24px 0 0; font-size: 13px; }
.listing-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.listing-facts dt { color: var(--soft); font-size: 13px; }
.listing-facts dd { margin: 1px 0 0; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 740px) {
  .listing-detail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "sidebar" "details"; gap: 14px; }
  .listing-detail.no-photo { grid-template-areas: "sidebar" "details"; }
  .listing-sidebar { position: static; }
}
.edit-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.edit-gallery figure { width: 128px; margin: 0; }
.edit-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.notice { color: #a13120; }
.conversation { max-width: 720px; }
.conversation article { margin-bottom: 12px; padding: 12px 16px; }
.conversation p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
body.account { background: var(--paper); color: var(--ink); padding: 20px; }
.account main {
  width: min(100%, 520px); margin: 24px auto; padding: clamp(18px, 5vw, 36px);
  background: var(--white); border: 1px solid var(--line); border-radius: 22px;
}
.account.wide main { width: min(100%, 760px); }
.account h1 { letter-spacing: -.04em; line-height: 1.07; }
.account a, .account summary, .account output { color: var(--ink); }
.account form label { display: block; margin-top: 14px; font-weight: 700; }
.account form input:not([type="hidden"]), .account form output { display: block; width: 100%; margin-top: 6px; }
.account form button { margin: 12px 8px 4px 0; }
.account:not(.wide) form button { width: 100%; }
.account details { margin: 18px 0; padding: 12px 0; border-block: 1px solid var(--line); }
.account summary { cursor: pointer; font-weight: 750; }
.account nav { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 14px; }
.account nav a { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); }
.account small { color: var(--soft); }
.account #status, .account [role=alert] { color: #a13120; }
.account .cover { background: linear-gradient(120deg, #151e32, #49567a); }
.account .cover { aspect-ratio: 3 / 1; margin-top: 20px; border-radius: 12px; overflow: hidden; }
.account .avatar { width: 88px; height: 88px; margin: -28px 0 0 14px; position: relative; overflow: hidden;
  border: 4px solid var(--white); border-radius: 50%; background: #f9e2d7; }
.account .cover img, .account .avatar img { width: 100%; height: 100%; object-fit: cover; }
.account details, .account form { border-color: var(--line); }
.account .g_id_signin { margin-block: 12px; }
.social-nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.social-content { max-width: 720px; }
.social-content article { padding: 14px 0; border-bottom: 1px solid var(--line); }
.social-content article p { white-space: pre-wrap; overflow-wrap: anywhere; }
.social-content form { margin: 10px 0; }
.social-content input:not([type=hidden]), .social-content textarea { display: block; width: 100%; margin: 8px 0; }
@media (max-width: 930px) {
  .categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 590px) {
  .market main, .site-header nav, .site-footer { width: calc(100% - 28px); }
  .market main { padding-top: 16px; }
  .site-header nav, .site-links { gap: 10px 14px; }
  .site-links { font-size: 14px; }
  .market-hero { border-radius: 16px; }
  .search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .search-row input:first-child { grid-column: 1 / -1; }
  .categories, .filter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .categories a { min-height: 53px; padding: 7px; gap: 6px; }
  .categories a span { flex-basis: 26px; height: 26px; }
}
