:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --paper: #fff;
  --ink: #17241d;
  --muted: #596961;
  --line: #dce4da;
  --leaf: #d9fa68;
  --dark: #172f25;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid #41764d; outline-offset: 3px; }
.wrap { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner, .top-nav, .brand { display: flex; align-items: center; }
.top-inner { min-height: 73px; justify-content: space-between; gap: 12px; }
.top-nav { gap: clamp(14px, 3vw, 32px); font-size: 15px; font-weight: 650; }
.top-nav > a:hover:not(.button), .footer a:hover { color: #387049; }
.brand { font-size: 31px; letter-spacing: -.085em; line-height: 1; font-weight: 850; width: max-content; }
.brand-dot { color: #53883b; }
.mark { display: grid; place-items: center; width: 35px; height: 35px; margin-right: 9px; border-radius: 11px; font-size: 23px; letter-spacing: 0; background: var(--leaf); color: var(--dark); }
.button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; font-size: 15px; font-weight: 750; line-height: 1.25; text-align: center; cursor: pointer; }
.button.primary { background: var(--leaf); color: #17241d; }
.button.primary:hover { background: #c9ef49; }
.button.secondary { border-color: var(--line); background: var(--paper); }
.button.secondary:hover { border-color: #9baa9e; background: #f4f7f0; }
.button.danger { background: #fff5f2; color: #962e2b; }
.button.danger:hover { background: #ffe2dc; }
.hero {
  position: relative; isolation: isolate; display: flex; align-items: center;
  min-height: 360px; overflow: hidden; margin-top: 28px; border-radius: 25px;
  background: var(--dark); color: white;
}
.hero::before {
  content: ""; z-index: -1; position: absolute; inset: 0;
  background: linear-gradient(90deg, #172f25 1%, #172f25 30%, #172f2500 71%), url(hero.jpg) right 49% / 77% auto no-repeat;
}
.hero-copy { padding: 36px clamp(24px, 5vw, 64px) 42px; }
.hero-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: #e2eadc; font-size: 14px; font-weight: 650; }
.hero-kicker span { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); }
.hero h1 { font-size: clamp(54px, 7.6vw, 105px); letter-spacing: -.085em; line-height: .87; }
.hero h1 span { color: var(--leaf); }
.hero p { margin-top: 22px; color: #e0eadf; font-size: clamp(15px, 2vw, 20px); }
.search-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(154px, .34fr) auto;
  gap: 8px; align-items: center; background: var(--paper); border: 1px solid var(--line);
  padding: 8px; border-radius: 15px; margin-top: 18px;
}
.search-panel label { display: flex; align-items: center; gap: 9px; padding-inline: 12px; }
.search-panel label img { width: 19px; height: 19px; }
.search-panel input, .search-panel select { min-width: 0; width: 100%; padding: 10px 5px; background: transparent; border: 0; }
.search-panel .button { min-width: 112px; }
.city-input { border-left: 1px solid var(--line); }
.categories { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 11px; margin: 20px 0 34px; }
.category {
  display: flex; align-items: center; flex-direction: column; justify-content: center;
  gap: 7px; min-height: 92px; padding: 9px 5px; text-align: center; font-weight: 700;
  font-size: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper);
}
.category:hover { border-color: #9cac91; }
.category.active { border-color: #abc681; background: #ebf4dc; }
.category-icon { width: 37px; height: 37px; display: grid; place-items: center; background: #edf2eb; border-radius: 11px; }
.category.active .category-icon { background: #d9ecb6; }
.category-icon img { width: 20px; height: 20px; }
.catalog { scroll-margin-top: 17px; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-header h2, h1, .panel h2 { letter-spacing: -.055em; line-height: 1.05; }
.section-header h2 { font-size: clamp(25px, 4vw, 40px); }
.sort select { max-width: 100%; width: auto; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-width: 0; height: 100%; }
.card > a { display: block; height: 100%; }
.card > a:focus-visible { outline-offset: -4px; }
.card:hover { border-color: #a4b4a1; }
.card-visual { position: relative; overflow: hidden; }
.listing-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e2ebe0; }
.placeholder { display: grid; place-items: center; background: linear-gradient(145deg, #eef2db, #c8dac9); }
.placeholder img { width: 17%; min-width: 32px; opacity: .8; }
.card-tag { position: absolute; top: 10px; left: 10px; padding: 5px 8px; background: #fffffff0; border-radius: 7px; font-size: 11px; font-weight: 750; }
.card-copy { display: grid; gap: 5px; padding: 12px 13px 15px; }
.card-copy h3 { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.price { font-size: 20px; font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; }
.city, .muted, small { color: var(--muted); font-size: 14px; }
.muted a { color: #285e38; text-decoration: underline; }
.panel { padding: 23px; border: 1px solid var(--line); background: var(--paper); border-radius: 17px; min-width: 0; }
.panel h2 { font-size: 25px; }
.panel h1, .page-heading h1 { font-size: clamp(29px, 5vw, 43px); overflow-wrap: anywhere; }
.empty { padding-block: 36px; text-align: center; }
.empty > * + * { margin-top: 12px; }
.back { display: inline-block; margin: 25px 0 15px; color: #355a43; font-weight: 650; }
.back:hover { text-decoration: underline; }
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-areas: "image info" "description info"; gap: 19px; align-items: start; }
.detail-image { grid-area: image; border-radius: 17px; aspect-ratio: 4 / 3; object-fit: contain; }
.description { grid-area: description; }
.description p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px; line-height: 1.55; }
.detail-info { grid-area: info; display: grid; gap: 12px; }
.detail-price { font-size: clamp(23px, 4vw, 34px); font-weight: 800; letter-spacing: -.05em; }
.seller { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 8px; overflow-wrap: anywhere; min-width: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 41px; height: 41px; border-radius: 50%; background: #e0efcf; font-weight: 800; }
.form-panel { width: min(670px, 100%); margin: 27px auto 0; padding: clamp(20px,4vw,34px); }
.back + .form-panel { margin-top: 0; }
.form-panel.compact { width: min(470px, 100%); }
.form-panel > p, .form-panel > form { margin-top: 20px; }
.stack { display: grid; gap: 15px; }
.stack label { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 700; }
.stack label[hidden] { display: none; }
.stack small { font-weight: 400; }
.stack input, .stack select, .stack textarea, .sort select {
  min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
}
.stack input, .stack select, .stack textarea { width: 100%; }
.stack input[type=file] { min-width: 0; }
.stack textarea { resize: vertical; }
.form-pair, .account { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account { grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile h2 { margin-bottom: 15px; }
.page-heading { margin-top: 27px; }
.account-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.actions, .pagination { display: flex; flex-wrap: wrap; gap: 7px; }
.pagination { margin-top: 17px; }
.actions .button { font-size: 13px; padding-inline: 9px; }
.notice { padding: 10px 15px; margin-top: 14px; border: 1px solid #b1c69c; border-radius: 10px; background: #edf5e6; }
.notice.error { border-color: #d9a09a; background: #fff1ef; }
.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; border-top: 1px solid var(--line); margin-top: 36px; padding-block: 19px; font-size: 14px; color: var(--muted); }
.brand.small { font-size: 23px; color: var(--ink); }
.brand.small .mark { width: 26px; height: 26px; font-size: 17px; border-radius: 8px; }
@media (max-width: 970px) {
  .grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .account-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .categories { gap: 7px; }
}
@media (max-width: 740px) {
  .wrap { width: calc(100% - 28px); }
  .categories { display: flex; overflow-x: auto; padding: 3px 3px 7px; margin: 14px -3px 22px; }
  .category { flex: 0 0 auto; min-width: 88px; padding-inline: 10px; min-height: 74px; }
  .hero { min-height: 285px; margin-top: 16px; }
  .hero::before { background-size: auto, 90% auto; }
  .grid { gap: 10px; }
  .account, .detail { grid-template-columns: 1fr; }
  .detail { grid-template-areas: "image" "info" "description"; }
}
@media (max-width: 540px) {
  .top-inner { min-height: 62px; }
  .top-nav { gap: 12px; }
  .catalog-link { display: none; }
  .publish-link { padding-inline: 8px; min-height: 40px; font-size: 12px; }
  .brand { font-size: 25px; }
  .mark { width: 29px; height: 29px; font-size: 19px; margin-right: 5px; }
  .hero { min-height: 260px; border-radius: 17px; }
  .hero::before { background: linear-gradient(90deg,#172f25 2%,#172f25a8 42%,#172f2500 94%), url(hero.jpg) 73% 48% / auto 110%; }
  .hero-copy { padding: 22px 18px; }
  .hero-kicker { font-size: 12px; }
  .hero h1 { font-size: clamp(46px, 12vw, 66px); }
  .hero p { margin-top: 15px; max-width: 200px; }
  .search-panel { grid-template-columns: minmax(0, 1fr) auto; gap: 3px; }
  .search-panel .search-input { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .search-panel .city-input { border: 0; }
  .search-panel .button { min-width: 76px; }
  .sort select { min-height: 37px; font-size: 12px; padding-inline: 5px; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card-copy { padding: 9px 10px 12px; }
  .card-copy h3 { font-size: 13px; }
  .price { font-size: 17px; }
  .card-tag { top: 6px; left: 6px; font-size: 10px; }
  .form-pair { grid-template-columns: 1fr; }
}
