:root {
  --bg: #f6f7f5; --surface: #ffffff; --text: #16201a; --muted: #5d6b62; --line: #dde3de;
  --accent: #2e7d4f; --accent-text: #ffffff; --good-bg: #e3f3e8; --bad-bg: #fbe4e2; --bad: #a3261b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418; --surface: #1a2026; --text: #e8ece9; --muted: #9aa7a0; --line: #2a323a;
    --accent: #4caf7a; --accent-text: #0b1210; --good-bg: #1d3325; --bad-bg: #3a1d1b; --bad: #ff8a80;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto;
       padding: calc(12px + env(safe-area-inset-top)) 16px calc(84px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.5rem; margin: 8px 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 4px; }
a { color: var(--accent); }
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.toggle { font-size: .9rem; }
.empty { color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; margin: 2px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.est { color: var(--accent); font-weight: 600; }
.odds { font-size: .85rem; margin: 2px 0; color: var(--muted); }
.odds.high { color: var(--accent); font-weight: 600; }
.odds.low { color: var(--bad); }
.sort { display: flex; gap: 6px; margin: 0 0 12px; }
.sort a { flex: 1; text-align: center; padding: 8px 10px; min-height: 40px; border: 1px solid var(--line);
          border-radius: 10px; text-decoration: none; color: var(--muted); background: var(--surface); }
.sort a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.card.dim { opacity: .55; }
.card-link { color: inherit; text-decoration: none; display: flex; gap: 12px; padding: 10px; }
.card img, .nophoto { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: none; background: var(--line); }
.nophoto { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.card form { border-top: 1px solid var(--line); margin: 0; }
button, .button { font: inherit; border-radius: 10px; padding: 10px 16px; border: 1px solid var(--line);
                  background: var(--surface); color: var(--text); text-decoration: none;
                  display: inline-block; cursor: pointer; min-height: 44px; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.ghost { border: 0; background: transparent; color: var(--muted); width: 100%; min-height: 40px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.actions form, .status { margin: 0; }
.photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.photos img { height: 260px; max-width: 90%; border-radius: 12px; scroll-snap-align: start; object-fit: cover; }
.body { white-space: pre-line; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.back { display: inline-block; margin: 4px 0; text-decoration: none; }
.flash { padding: 10px 12px; border-radius: 10px; }
.flash.good { background: var(--good-bg); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.login { max-width: 360px; margin: 18vh auto 0; display: grid; gap: 12px; }
.login input { font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
               background: var(--surface); color: var(--text); }
.error { color: var(--bad); margin: 0; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface);
        border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs a { flex: 1; text-align: center; padding: 14px 0; color: var(--muted); text-decoration: none; font-weight: 600; }
.tabs a.on { color: var(--accent); }
section { margin-bottom: 20px; }
.count { color: var(--muted); font-weight: 400; }
.flips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.flips li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row button.ghost { width: auto; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 32px; }
.sold { display: grid; gap: 8px; margin-top: 8px; }
.sold input, .sold select, .sold textarea { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line);
                            background: var(--bg); color: var(--text); width: 100%; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; }
.tile span:last-child { color: var(--muted); font-size: .8rem; }
.big { font-size: 1.4rem; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.health { color: var(--muted); }
.banner { background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 12px;
          margin-bottom: 12px; display: grid; gap: 8px; }
.banner p { margin: 0; }
[hidden] { display: none !important; }
.badge { font-size: .75rem; font-weight: 600; padding: 1px 6px; border-radius: 6px;
         background: var(--good-bg); color: var(--accent); }
.week { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.week ul { margin: 4px 0; padding-left: 18px; }
.note { background: var(--surface); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 8px; font-size: .9rem; }
.message textarea { width: 100%; font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line);
                    background: var(--bg); color: var(--text); }
.flips textarea { width: 100%; font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line);
                  background: var(--bg); color: var(--text); margin: 4px 0; }
.listing-card h3 { margin: 0 0 6px; font-size: 1rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.verdict { font-size: 2rem; font-weight: 800; text-align: center; padding: 12px; border-radius: 12px; margin: 8px 0; }
.verdict-buy { background: var(--good-bg); color: var(--accent); }
.verdict-maybe, .verdict-unsure { background: var(--surface); border: 1px solid var(--line); }
.verdict-skip { background: var(--bad-bg); color: var(--bad); }
