/* Karma Market prototype. The palette and type follow the wallet's Classic
   theme and the Market brief. Colors live in variables so more themes can be
   added later without touching the rules below. */
:root {
  --bg: #1a1410; --card: #241c14; --alt: #2a2018; --gold: #c9a84c; --text: #e8dcc8; --muted: #a89a82;
  --hair: rgba(201,168,76,.18); --chip: rgba(201,168,76,.12);
  --display: 'Cormorant Garamond', Georgia, serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --app-w: 460px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: #120e0b; }
body { margin: 0 auto; max-width: var(--app-w); min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 14px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button { font-family: inherit; }

.page { padding: 20px 16px 40px; }
.head { display: flex; align-items: baseline; gap: 10px; }
.head h1 { flex: 1; margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; }
.count { font-size: 12px; color: var(--muted); }
.count::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: 1px; }
.tagline { margin: 4px 0 16px; font-size: 14px; color: var(--muted); }

.chips { display: flex; gap: 8px; margin: 0 -16px 16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(201,168,76,.15); background: var(--chip); color: var(--gold); font-size: 13px; cursor: pointer; }
.chip.on { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }

.grid { column-count: 2; column-gap: 12px; }
.card { display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--card); color: var(--text); text-align: left; cursor: pointer; break-inside: avoid; }
.card .photo { position: relative; display: block; }
.card img { display: block; width: 100%; height: 164px; object-fit: cover; }
.card:nth-child(even) img { height: 128px; }
.badge { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: var(--bg); font-size: 11px; font-weight: 600; }
.card .info { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; }
.card .title { font-family: var(--display); font-size: 20px; line-height: 1.12; }
.card .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-width: 0; }
.price { flex: 1; font-family: var(--display); font-size: 20px; color: var(--gold); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--muted); }
.who span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--chip); border: 1px solid rgba(201,168,76,.15); color: var(--gold); font-size: 10px; font-weight: 600; }
.empty { padding: 28px 0; text-align: center; color: var(--muted); }
.proto { margin-top: 24px; text-align: center; font-size: 12px; color: var(--muted); }

/* listing page */
.back { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0; border: 0; background: none; color: var(--gold); font-size: 14px; cursor: pointer; }
.hero { display: block; width: 100%; height: 260px; object-fit: cover; border-radius: 16px; margin: 4px 0 16px; }
.l-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.l-desc { margin: 6px 0 14px; color: var(--muted); }
.seller { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.seller .name { font-weight: 600; }
.seller .tag { font-size: 12px; color: var(--gold); }
.promise { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); margin-bottom: 16px; }
.row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.row .label { font-size: 12px; color: var(--muted); }
.row .price { flex: none; font-size: 28px; }
.btn { display: block; width: 100%; height: 52px; border: 0; border-radius: 14px; background: var(--gold); color: var(--bg); font-size: 15px; font-weight: 600; cursor: pointer; }
.fine { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--hair); color: var(--text); font-size: 13px; }

/* password gate */
#gate { position: fixed; inset: 0; z-index: 99; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.gate-box { width: 100%; max-width: 300px; padding: 24px; text-align: center; }
.gate-k { font-family: Georgia, serif; font-size: 44px; line-height: 1; color: var(--gold); }
.gate-t { margin: 14px 0 22px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
#gate input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(201,168,76,.3); background: var(--card); color: var(--text); font-size: 15px; text-align: center; outline: none; }
#gate input:focus { border-color: var(--gold); }
#gate button { width: 100%; margin-top: 10px; padding: 12px; border: 0; border-radius: 10px; background: var(--gold); color: var(--bg); font-size: 14px; font-weight: 700; cursor: pointer; }
.gate-e { min-height: 16px; margin-top: 10px; font-size: 12px; color: #d9534f; }
