:root {
  --ink: #1e2d2a;
  --forest: #22463d;
  --brass: #a3854f;
  --brass2: #c8b184;
  --cream: #faf8f2;
  --paper: #ffffff;
  --muted: #74766c;
  --line: #e2dccc;
  --soft: #efe9db;
  --sage: #5c7a6f;
}

* { box-sizing: border-box; }

body.bw-app {
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.bw-serif { font-family: Georgia, "Times New Roman", serif; }

a { color: inherit; text-decoration: none; }

/* header */
.bw-head { position: sticky; top: 0; z-index: 20; background: rgba(250, 248, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bw-head-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.bw-brand { background: none; border: 0; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; }
.bw-mark { font-family: Georgia, serif; font-weight: 700; font-size: 20px; letter-spacing: 2.5px; color: var(--forest); }
.bw-tag { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
.bw-searchwrap { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 8px 14px; width: min(360px, 48vw); }
.bw-search { border: 0; outline: 0; background: none; font-size: 14px; width: 100%; color: var(--ink); }

.bw-authlink { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.bw-authlink a { color: var(--forest); font-weight: 600; }
.bw-linkbtn { background: none; border: 0; padding: 0; color: var(--forest); font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; }

.bw-messages { list-style: none; margin: 0 0 16px; padding: 0; }
.bw-message { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; background: #eef3ef; color: #2c6b4a; border: 1px solid #cfe3d6; }
.bw-message--error { background: #f3e5db; color: #9a5a3a; border-color: #e6cdb8; }

.bw-loginform { display: flex; flex-direction: column; }
.bw-form-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 4px; }
.bw-loginform input[type="text"], .bw-loginform input[type="password"], .bw-loginform input[type="file"] {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--ink); background: var(--paper);
}

.bw-main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; }
.bw-hero { padding: 16px 0 22px; max-width: 720px; }
.bw-h1 { font-family: Georgia, serif; font-size: 30px; line-height: 1.15; margin: 0 0 10px; color: var(--forest); letter-spacing: .2px; }
.bw-sub { color: #4a5450; margin: 0; font-size: 15px; }

.bw-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bw-chip { border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 7px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: .15s; display: inline-block; }
.bw-chip:hover { border-color: var(--brass); }
.bw-chip.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.bw-filters-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bw-gradepick { display: flex; align-items: center; gap: 4px; }
.bw-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-right: 4px; }
.bw-gbtn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); transition: .15s; display: inline-flex; align-items: center; justify-content: center; }
.bw-gbtn.on { background: var(--brass); border-color: var(--brass); color: #fff; }
.bw-sort-links { display: flex; gap: 6px; }
.bw-sort-link { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.bw-sort-link.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.bw-advfilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0; }
.bw-advfilters select, .bw-advfilters input[type="number"] { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--ink); }
.bw-price-range { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.bw-price-range input { width: 90px; }
.bw-count { font-size: 12px; color: var(--muted); margin: 16px 2px; letter-spacing: .3px; }

.bw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 20px; }
.bw-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; display: flex; flex-direction: column; }
.bw-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(30, 45, 42, .10); border-color: var(--brass2); }
.bw-card-img { position: relative; aspect-ratio: 16/10; background: var(--soft); }
.bw-acc { width: 100%; height: 100%; display: block; object-fit: cover; }
.bw-verified { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; background: var(--forest); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px; letter-spacing: .3px; }
.bw-verified.big { position: static; }
.bw-card-seal { position: absolute; right: 10px; bottom: -14px; }
.bw-card-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bw-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--brass); font-weight: 700; }
.bw-card-title { font-family: Georgia, serif; font-size: 18px; margin: 0; color: var(--ink); line-height: 1.2; }
.bw-card-spec { font-size: 13px; color: var(--muted); }
.bw-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.bw-chip-mini { font-size: 11px; background: var(--soft); color: #5a5f53; padding: 2px 8px; border-radius: 10px; }
.bw-card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--soft); }
.bw-city { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.bw-price { font-family: Georgia, serif; font-size: 18px; font-weight: 700; color: var(--forest); }

.bw-seal { position: relative; border-radius: 50%; background: #fff; border: 2px solid var(--brass); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--brass2); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bw-seal-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.bw-seal-grade { font-family: Georgia, serif; font-weight: 700; }
.bw-seal-band { font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--brass); margin-top: 2px; }
.bw-seal-score { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; color: var(--muted); }

.bw-empty { padding: 40px 0; text-align: center; color: var(--muted); }
.bw-reset { display: inline-block; margin-top: 10px; border: 1px solid var(--line); background: var(--paper); padding: 8px 16px; border-radius: 20px; cursor: pointer; }

.bw-foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; }

/* detail */
.bw-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--forest); font-size: 14px; cursor: pointer; padding: 4px 0; margin-bottom: 10px; }
.bw-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: start; }
.bw-detail-media { position: relative; }
.bw-media-big { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--soft); }
.bw-media-big .bw-verified.big { position: absolute; left: 12px; top: 12px; }
.bw-gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--forest); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bw-gal-nav:hover { border-color: var(--brass); }
.bw-gal-prev { left: 10px; }
.bw-gal-next { right: 10px; }
.bw-media-seal { position: absolute; right: 16px; bottom: -6px; }
.bw-detail-title { font-family: Georgia, serif; font-size: 27px; margin: 2px 0 8px; color: var(--ink); line-height: 1.15; }
.bw-blurb { color: #4a5450; margin: 0 0 16px; }
.bw-buybox { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.bw-buy-top { display: flex; align-items: center; justify-content: space-between; }
.bw-buy-price { font-family: Georgia, serif; font-size: 28px; font-weight: 700; color: var(--forest); }
.bw-buy-actions { display: flex; gap: 10px; margin: 14px 0 12px; }
.bw-btn { flex: 1; padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: .15s; text-align: center; }
.bw-btn.primary { background: var(--forest); color: #fff; }
.bw-btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.bw-escrow { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #3f4a46; background: #eef3ef; border-radius: 8px; padding: 9px 11px; }
.bw-trust { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; letter-spacing: .2px; }
.bw-certbtn { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px dashed var(--brass); color: var(--forest); padding: 11px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.bw-certbtn:hover { background: #faf6ec; }

/* certificate verify page */
.bw-verify { max-width: 640px; margin: 0 auto; }
.bw-verify-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--forest); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 20px; margin-bottom: 14px; }
.bw-verify-badge--invalid { background: #9a5a3a; }
.bw-verify-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-top: 18px; }
.bw-verify-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bw-verify-note { font-size: 12px; color: var(--muted); margin-top: 18px; text-align: center; }

.bw-photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.bw-photo-thumb { aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.bw-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bw-gallery-thumbs .bw-photo-thumb { cursor: pointer; transition: border-color .15s; }
.bw-gallery-thumbs .bw-photo-thumb--active { border-color: var(--forest); border-width: 2px; }

.bw-section { margin-top: 30px; }
.bw-sec-h { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--brass); font-weight: 700; margin: 0 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.bw-specgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.bw-spec-k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.bw-spec-v { font-weight: 600; color: var(--ink); font-size: 14px; }

.bw-cond { width: 100%; border-collapse: collapse; }
.bw-cond td { padding: 10px 0; border-bottom: 1px solid var(--soft); vertical-align: top; font-size: 14px; }
.bw-cl { width: 34%; font-weight: 600; }
.bw-cr { width: 150px; }
.bw-cn { color: var(--muted); }
.bw-pill { display: inline-block; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; padding: 2px 9px; border-radius: 11px; font-weight: 700; background: #e4efe6; color: #2c6b4a; }

.bw-tune { width: 100%; border-collapse: collapse; max-width: 520px; }
.bw-tune th { text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 6px 10px; border-bottom: 1.5px solid var(--brass2); }
.bw-tune td { padding: 8px 10px; border-bottom: 1px solid var(--soft); font-size: 14px; }
.mono { font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; }

@media (max-width: 760px) {
  .bw-detail { grid-template-columns: 1fr; gap: 22px; }
  .bw-specgrid { grid-template-columns: 1fr 1fr; }
  .bw-h1 { font-size: 24px; }
  .bw-head-in { flex-wrap: wrap; gap: 12px; }
  .bw-searchwrap { margin-left: 0; width: 100%; }
  .bw-filters { flex-direction: column; align-items: stretch; }
  .bw-filters-right { justify-content: space-between; }
  .bw-cl { width: 40%; } .bw-cn { display: none; }
}
