:root { --bg: #0f1115; --card: #191c22; --line: #2a2e37; --text: #eef0f4; --muted: #8b93a3; --acc: #00a6ff; --good: #2ecc71; --warn: #f5a623; --bad: #ff5a5f; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--acc); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); min-height: 1.2em; font-size: 14px; }

.login { max-width: 360px; margin: 0 auto; padding: 14vh 24px 24px; text-align: center; }
.login img { border-radius: 22px; }
.login h1 { margin: 12px 0 4px; font-size: 30px; }
.login form { display: grid; gap: 10px; margin-top: 24px; }

input, textarea, select { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, textarea:focus { border-color: var(--acc); }
textarea { resize: vertical; min-height: 120px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; background: #262a33; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--acc); color: #fff; }
.btn.big { width: 100%; padding: 18px; font-size: 18px; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }

header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; background: rgba(15,17,21,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header h1 { flex: 1; margin: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; }
.icon:active { background: #262a33; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { padding: 12px 12px 96px; max-width: 760px; margin: 0 auto; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #14171c; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav button { flex: 1; border: 0; background: none; padding: 8px 0 10px; font-size: 12px; color: var(--muted); display: grid; gap: 2px; justify-items: center; cursor: pointer; }
nav button span { font-size: 22px; filter: grayscale(1); opacity: .7; }
nav button.on { color: var(--acc); }
nav button.on span { filter: none; opacity: 1; }

#banner:empty { display: none; }
.note { margin: 10px 12px 0; padding: 12px 14px; border-radius: 12px; background: #1d2a36; font-size: 14px; }
.note.warn { background: #3a2c12; }
.note .btn { margin-top: 8px; }

.card { background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.ask { display: flex; gap: 8px; margin-bottom: 14px; }
.ask input { flex: 1; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #262a33; color: var(--muted); }
.chip.new { background: var(--acc); color: #fff; }
.chip.err { background: #3a1d1f; color: #ff9a9d; }

.search { cursor: pointer; }
.search .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.search .row { margin-top: 10px; }

.item { display: flex; gap: 12px; background: var(--card); border-radius: 14px; padding: 10px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.item img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: #262a33; flex: none; }
.item .t { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .p { font-size: 18px; font-weight: 700; margin: 2px 0; }
.item .v { font-size: 13px; color: var(--muted); }
.item.fresh { outline: 2px solid var(--acc); }
.score { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 13px; font-weight: 700; color: #fff; margin-right: 6px; vertical-align: 2px; }
.s-hi { background: var(--good); } .s-mid { background: var(--warn); } .s-lo { background: #555b66; }

.photos { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.photos img { height: 120px; border-radius: 10px; }
.lot .price { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.market { font-size: 14px; background: #14171c; border-radius: 10px; padding: 10px; margin-top: 10px; }
.actions { display: grid; gap: 8px; margin-top: 12px; }
.actions .row .btn { flex: 1; }

.reply .q { font-size: 14px; color: var(--muted); }
.reply .a { margin-top: 6px; white-space: pre-wrap; }
.seg { display: flex; background: #14171c; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px 4px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--acc); color: #fff; font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
#toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: #2d323c; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 9; }
#toast.on { opacity: 1; }
.loading { text-align: center; padding: 30px; color: var(--muted); }
