:root {
  color-scheme: light;
  --ink: #211e29;
  --muted: #777380;
  --paper: #f7f5f0;
  --white: #fffefa;
  --line: #e6e2dc;
  --purple: #6d45db;
  --purple-light: #eee8ff;
  --lime: #d9fc67;
  --font: "Trebuchet MS", Arial, sans-serif;
  --display: "Arial", sans-serif;
  --mono: "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { height: 78px; padding: 0 clamp(20px, 6vw, 92px); display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 19px var(--display); letter-spacing: .08em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--purple); border-radius: 11px 11px 11px 2px; color: white; font: 700 14px var(--display); letter-spacing: -.04em; }
.topbar nav { display: flex; gap: clamp(16px, 3vw, 38px); margin-left: 4vw; }
.topbar nav a, .footer > a:not(.brand) { color: var(--muted); font-size: 13px; text-decoration: none; }
.topbar nav a:hover, .footer > a:not(.brand):hover { color: var(--purple); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.button { min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--purple); color: white; }
.button-primary:hover { background: #5935c5; }
.button-quiet { color: var(--ink); background: transparent; border-color: var(--line); }
.button-quiet:hover { background: #f2effa; }
.button-dark { color: white; background: var(--ink); }
.button-report { color: #954132; background: #fff2ec; border-color: #f5d2c4; }
.full-width { width: 100%; }

.hero { min-height: 555px; padding: 88px clamp(24px, 11vw, 170px) 52px; position: relative; overflow: hidden; background: var(--ink); color: white; }
.hero:after { content: ""; width: 420px; height: 420px; border: 1px solid #ffffff20; border-radius: 50%; position: absolute; right: 9%; top: 56px; box-shadow: 0 0 0 44px #ffffff08, 0 0 0 88px #ffffff05; }
.hero-copy { max-width: 730px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 13px; color: var(--purple); font: 500 10px var(--mono); letter-spacing: .18em; }
.hero .eyebrow { color: var(--lime); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); }
.hero h1 { margin: 0; font-size: clamp(46px, 7.5vw, 88px); line-height: .99; letter-spacing: -.07em; }
.hero h1 span { color: var(--lime); }
.hero-text { max-width: 470px; margin: 25px 0 27px; color: #c7c3cf; font-size: 15px; }
.hero-cta { min-height: 49px; padding: 12px 20px; color: var(--ink); background: var(--lime); }
.hero-stamp { width: 164px; height: 164px; display: grid; place-content: center; position: absolute; z-index: 1; top: 174px; right: 18%; border: 1px solid #ffffff60; border-radius: 50%; transform: rotate(11deg); text-align: center; font: 11px/1.4 var(--mono); letter-spacing: .14em; }
.hero-stamp b { margin-top: 8px; color: var(--lime); font-size: 20px; }
.hero-bottom { position: absolute; bottom: 23px; left: clamp(24px, 6vw, 92px); right: clamp(24px, 6vw, 92px); display: flex; justify-content: space-between; color: #aaa6b1; font: 9px var(--mono); letter-spacing: .12em; }
.section-wrap { padding: 84px clamp(24px, 8vw, 125px); }
.catalogue { max-width: 1500px; margin: 0 auto; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h2, .how h2, .about h2, .admin-area h2 { margin: 0; font-size: clamp(34px, 4vw, 50px); line-height: 1.05; letter-spacing: -.055em; }
.filters { display: flex; gap: 10px; margin: 30px 0 13px; }
.search-box, .select-wrap { display: flex; align-items: center; height: 47px; padding: 0 13px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.search-box { flex: 1; gap: 9px; color: var(--muted); }
.search-box > span { font-size: 23px; }
.search-box input { width: 100%; border: 0; outline: none; background: transparent; font-size: 13px; }
.select-wrap select, .field select { min-width: 160px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 13px; }
.result-count { min-height: 20px; margin: 0 0 17px; color: var(--muted); font: 10px var(--mono); }
.listing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.listing-card { min-width: 0; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 8px; transition: transform .2s, box-shadow .2s; }
.listing-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px #33274712; }
.listing-open { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.listing-image { height: 205px; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #f2edff, #fbf5e5); }
.listing-image img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { position: absolute; color: #a99cce; font: 700 28px var(--display); letter-spacing: -.07em; pointer-events: none; }
.image-placeholder span, .detail-placeholder span { display: block; font: 8px var(--mono); letter-spacing: .15em; text-align: center; }
.listing-image:not(.no-image) .image-placeholder { display: none; }
.category-tag { position: absolute; top: 11px; left: 11px; padding: 5px 8px; background: #fffef0e8; border-radius: 4px; color: #59459a; font: 9px var(--mono); }
.listing-info { padding: 15px; }
.listing-info h3 { margin-bottom: 5px; font-size: 16px; letter-spacing: -.035em; }
.listing-description { display: -webkit-box; min-height: 42px; margin: 0 0 11px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.listing-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10px; }
.listing-meta time { white-space: nowrap; }
.listing-price { display: block; margin-top: 9px; font: 700 20px var(--display); }
.empty-state { grid-column: 1 / -1; padding: 40px 20px; color: var(--muted); text-align: center; background: #fffefa; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; }

.how { display: grid; grid-template-columns: .8fr 1.4fr; gap: 9vw; background: #eeebe5; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-steps article { padding-top: 12px; border-top: 1px solid #d3cfc8; }
.how-steps article > span, .guide-number { color: var(--purple); font: 12px var(--mono); }
.how-steps h3 { margin: 24px 0 8px; font-size: 17px; }
.how-steps p { margin: 0; color: var(--muted); font-size: 12px; }
.about { display: grid; grid-template-columns: .85fr 1fr; gap: 9vw; }
.about-copy { max-width: 560px; color: #55515d; font-size: 14px; }
.about-subheading { margin: 22px 0 8px; color: var(--ink); font-size: 17px; }
.about-copy a { color: var(--purple); font-weight: 700; text-decoration: none; }
.about-copy .small-note { margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer { min-height: 82px; padding: 18px clamp(24px, 6vw, 92px); display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer .brand { color: var(--ink); }

.dialog { width: min(520px, calc(100% - 28px)); max-height: min(90vh, 850px); padding: 33px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); box-shadow: 0 24px 90px #16131d55; }
.dialog::backdrop { background: #17141dbb; backdrop-filter: blur(3px); }
.dialog h2 { margin: 0 0 22px; font-size: 29px; letter-spacing: -.055em; }
.dialog-close { width: 34px; height: 34px; position: absolute; top: 15px; right: 15px; border: 0; border-radius: 50%; background: #f0edf2; color: var(--ink); font-size: 24px; }
.auth-tabs { display: flex; gap: 6px; margin: 15px 0 19px; padding: 4px; background: #f0edf2; border-radius: 7px; }
.auth-tabs button { flex: 1; padding: 9px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; }
.auth-tabs button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px #17141d18; }
.field { display: block; margin: 13px 0; font-size: 12px; font-weight: 700; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; outline-color: var(--purple); font-size: 13px; font-weight: 400; }
.field textarea { resize: vertical; }
.consent-field { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0; color: #625e69; font-size: 11px; font-weight: 400; }
.consent-field input { margin: 2px 0 0; accent-color: var(--purple); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.optional { color: var(--muted); font-weight: 400; }
.form-help, .privacy-note { color: var(--muted); font-size: 10px; }
.form-help a { color: var(--purple); }
.privacy-note { margin: 17px 0 0; line-height: 1.5; }
.form-message { min-height: 20px; margin: 8px 0; color: #a23b2e; font-size: 12px; }
.detail-dialog { width: min(620px, calc(100% - 28px)); }
.detail-dialog .eyebrow { margin-right: 24px; }
.detail-image, .detail-placeholder { width: 100%; height: 260px; object-fit: contain; border-radius: 7px; background: #f2edff; }
.detail-placeholder { display: grid; place-content: center; color: #a99cce; font: 700 40px var(--display); }
.detail-dialog h2 { margin: 20px 0 8px; }
.detail-description { white-space: pre-wrap; color: #55515d; font-size: 14px; }
.detail-price { margin-bottom: 5px; font: 700 27px var(--display); }
.seller-contacts { margin: 17px 0; padding: 14px; display: flex; flex-direction: column; gap: 5px; background: #f4f0ff; border-radius: 7px; font-size: 12px; }
.seller-contacts h3 { margin: 0 0 3px; font-size: 14px; }
.seller-contacts a { color: var(--purple); overflow-wrap: anywhere; }
.small-note { color: var(--muted); font-size: 11px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.chat-dialog { width: min(920px, calc(100% - 24px)); }
.chat-layout { min-height: 420px; display: grid; grid-template-columns: 245px 1fr; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.conversation-list { max-height: 55vh; overflow-y: auto; border-right: 1px solid var(--line); background: #f8f6f1; }
.conversation-item { width: 100%; padding: 13px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.conversation-item.active { background: var(--purple-light); }
.conversation-item strong { font-size: 12px; }
.conversation-item span, .conversation-item small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel { min-height: 420px; max-height: 55vh; display: flex; flex-direction: column; overflow-y: auto; }
.message-list { flex: 1; padding: 14px; }
.message { max-width: 85%; margin: 0 0 12px; padding: 10px 12px; background: #f0edf2; border-radius: 9px 9px 9px 2px; }
.message.mine { margin-left: auto; background: var(--purple-light); border-radius: 9px 9px 2px 9px; }
.message.moderated { background: #fff2ec; color: #805246; }
.message-heading { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 9px; }
.message p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.text-button { padding: 5px 0 0; border: 0; background: none; color: #985247; font-size: 10px; }
.message-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.message-form input { min-width: 0; flex: 1; padding: 9px; border: 1px solid var(--line); border-radius: 5px; outline-color: var(--purple); font-size: 12px; }
.my-listing { padding: 12px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.my-listing > div { display: flex; flex-direction: column; }
.my-listing strong { font-size: 13px; }
.my-listing span { color: var(--muted); font-size: 10px; }
.admin-area { border-top: 1px solid var(--line); background: #f0edf2; }
.admin-area > .small-note { max-width: 640px; margin-top: 12px; }
.report-card { margin-top: 14px; padding: 17px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.report-header, .report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-status { color: var(--muted); font: 10px var(--mono); }
.report-card h3 { margin: 12px 0 4px; font-size: 16px; }
.report-card p { margin-bottom: 7px; font-size: 12px; overflow-wrap: anywhere; }
.report-card time { color: var(--muted); font-size: 10px; }
.report-actions { margin-top: 12px; }
.report-actions .button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.report-context-box { margin-top: 12px; padding: 12px; background: #f6f4f0; border-radius: 5px; }
.report-context-box p { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.toast { max-width: min(420px, calc(100% - 32px)); position: fixed; z-index: 10; right: 20px; bottom: 20px; padding: 12px 17px; transform: translateY(15px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border-radius: 7px; font-size: 12px; transition: .2s; }
.toast.visible { transform: translateY(0); opacity: 1; }

.guide-main { max-width: 840px; min-height: 75vh; margin: 0 auto; padding: 82px 26px; }
.guide-main h1 { margin: 0 0 20px; font-size: clamp(46px, 8vw, 76px); line-height: .98; letter-spacing: -.07em; }
.guide-main h1 span { color: var(--purple); }
.guide-intro { max-width: 650px; margin-bottom: 38px; color: #625e69; font-size: 16px; }
.guide-card { display: grid; grid-template-columns: 55px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.guide-card h2 { margin: 0 0 8px; font-size: 20px; }
.guide-card p { margin: 0 0 9px; color: #625e69; font-size: 13px; }
.guide-card code { padding: 2px 5px; border-radius: 3px; background: #eee8ff; color: #5235a7; }
.guide-warning { margin: 16px 0; padding: 16px; border-left: 3px solid #e5a33c; background: #fff7e8; color: #5b4a2e; font-size: 12px; }
.guide-back { margin-top: 32px; }
.bootstrap-card { max-width: 520px; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.bootstrap-card [disabled] { opacity: .55; cursor: not-allowed; }

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f1eef8;
  --muted: #aaa5b5;
  --paper: #17151e;
  --white: #211e29;
  --line: #393543;
  --purple-light: #382a58;
}
body[data-theme="dark"] .button-quiet { color: var(--ink); }
body[data-theme="dark"] .button-quiet:hover,
body[data-theme="dark"] .dialog-close,
body[data-theme="dark"] .auth-tabs { background: #302c39; }
body[data-theme="dark"] .search-box,
body[data-theme="dark"] .select-wrap,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .message-form input { background: #211e29; color: var(--ink); }
body[data-theme="dark"] .search-box input { color: var(--ink); }
body[data-theme="dark"] .how,
body[data-theme="dark"] .admin-area { background: #201d28; }
body[data-theme="dark"] .about-copy,
body[data-theme="dark"] .detail-description,
body[data-theme="dark"] .consent-field { color: #c1bdca; }
body[data-theme="dark"] .about-subheading { color: var(--ink); }
body[data-theme="dark"] .listing-image { background: linear-gradient(145deg, #302742, #312d24); }
body[data-theme="dark"] .category-tag { background: #292535ed; color: #d9ccff; }
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .report-card { background: #211e29; }
body[data-theme="dark"] .conversation-list,
body[data-theme="dark"] .report-context-box { background: #1c1923; }
body[data-theme="dark"] .message { background: #302c39; }
body[data-theme="dark"] .message.moderated { background: #482d2a; color: #f0b7a8; }
body[data-theme="dark"] .seller-contacts { background: #302742; }
body[data-theme="dark"] .detail-image,
body[data-theme="dark"] .detail-placeholder { background: #302742; }
body[data-theme="dark"] .guide-card code { background: #382a58; color: #d9ccff; }
body[data-theme="dark"] .guide-warning { background: #3b3020; color: #f2d9aa; }
body[data-theme="dark"] .auth-tabs button.active { background: #211e29; color: var(--ink); }
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder { color: #928c9d; }
:focus-visible { outline: 3px solid #9578f1; outline-offset: 2px; }

@media (max-width: 1100px) {
  .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-wrap { padding-left: clamp(22px, 5vw, 64px); padding-right: clamp(22px, 5vw, 64px); }
}
@media (max-width: 900px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stamp { right: 8%; }
  .how { grid-template-columns: 1fr; gap: 35px; }
  .about { gap: 5vw; }
}
@media (max-width: 650px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 17px; flex-wrap: wrap; gap: 12px; }
  .topbar nav { order: 3; width: 100%; justify-content: space-between; margin: 0; }
  .topbar nav a { font-size: 11px; }
  .top-actions { flex: 1; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .top-actions .button { min-height: 40px; padding: 8px; font-size: 10px; }
  .hero { min-height: 505px; padding: 80px 25px 65px; }
  .hero h1 { font-size: clamp(48px, 12vw, 68px); }
  .hero-stamp { width: 100px; height: 100px; top: auto; right: 25px; bottom: 75px; font-size: 8px; }
  .hero-bottom { font-size: 7px; }
  .section-wrap { padding: 59px 20px; }
  .section-heading { align-items: flex-start; }
  .section-heading > .button { padding: 9px; font-size: 10px; }
  .filters { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; min-width: 0; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .listing-image { height: 155px; }
  .listing-info { padding: 11px; }
  .listing-info h3 { font-size: 13px; }
  .listing-meta { flex-direction: column; gap: 0; }
  .listing-price { font-size: 17px; }
  .how-steps { grid-template-columns: 1fr; gap: 19px; }
  .how-steps h3 { margin-top: 12px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .footer { flex-wrap: wrap; }
  .footer > span:nth-child(2) { display: none; }
  .dialog { padding: 27px 20px; }
  .chat-layout { grid-template-columns: 1fr; }
  .conversation-list { max-height: 145px; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-item { min-width: 145px; border-right: 1px solid var(--line); }
  .chat-panel { min-height: 330px; max-height: 45vh; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .detail-image, .detail-placeholder { height: 200px; }
}
@media (max-width: 390px) {
  .topbar { padding-inline: 12px; }
  .topbar nav { gap: 8px; }
  .topbar nav a { font-size: 10px; }
  .listing-grid { grid-template-columns: 1fr; }
  .listing-image { height: 220px; }
  .hero-stamp { display: none; }
  .section-heading { flex-direction: column; }
  .section-heading > .button { align-self: stretch; }
  .footer { align-items: flex-start; flex-direction: column; }
}
