:root {
  --green: #16a34a; --green-light: #dcfce7; --green-dark: #14532d;
  --blue: #2563eb; --blue-light: #dbeafe;
  --yellow: #d97706; --yellow-light: #fef3c7;
  --red: #dc2626; --red-light: #fee2e2;
  --purple: #7c3aed; --purple-light: #ede9fe;
  --gray: #6b7280; --surface: #ffffff;
  --bg: #f1f5f9; --border: #e2e8f0;
  --text: #0f172a; --text-soft: #475569; --text-muted: #94a3b8;
  --radius: 16px; --shadow: 0 4px 20px rgba(0,0,0,.07);
}
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, Arial, sans-serif; margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── header ── */
header { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); color: white; padding: 24px 32px; }
.header-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
header h1 { margin: 0 0 4px; font-size: 1.65rem; font-weight: 700; }
header p { margin: 0; opacity: .72; font-size: .85rem; }
.header-stats { display: flex; gap: 16px; }
.stat { background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px 18px; text-align: center; }
.stat span { display: block; font-size: 1.6rem; font-weight: 800; }
.stat small { font-size: 10px; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }

/* ── legend ── */
.usecase-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 20px; align-items: center; }
.usecase-legend span { opacity: .75; }

/* ── section title ── */
.section-title { font-size: .8rem; font-weight: 700; margin: 0 0 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* ── scenario cards ── */
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.option-card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 2px solid var(--border); }
.option-a { border-color: var(--green); }
.option-b { border-color: var(--blue); }
.option-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 5px; }
.option-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.option-desc { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.option-bike { font-size: 13px; margin-bottom: 10px; line-height: 1.9; }
.opt-price { font-size: 1.1rem; font-weight: 800; }
.option-pros { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-soft); }

/* ── filters ── */
.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.filters input, .filters select {
  padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13px; background: white; color: var(--text); outline: none; transition: border-color .15s;
}
.filters input:focus, .filters select:focus { border-color: var(--blue); }
.filters input[type="text"] { width: 190px; }
.filters select { width: 170px; }
.filters input[type="number"] { width: 155px; }
.reset-btn { padding: 9px 18px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; background: white; cursor: pointer; color: var(--text-soft); transition: all .15s; align-self: flex-end; }
.reset-btn:hover { background: var(--bg); }
.result-count { align-self: flex-end; font-size: 12px; color: var(--text-muted); padding: 9px 0; }

/* ── cards grid ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-bottom: 32px; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border: 2px solid transparent;
  transition: transform .15s, box-shadow .15s; position: relative;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.11); }
.card.rank-1 { border-color: #fbbf24; }
.card.rank-2 { border-color: #94a3b8; }
.card.rank-3 { border-color: #cd7c3b; }

.card-rank-badge {
  position: absolute; top: -11px; left: 16px;
  font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .04em;
}
.badge-gold { background: #fbbf24; color: #78350f; }
.badge-silver { background: #94a3b8; color: white; }
.badge-bronze { background: #cd7c3b; color: white; }
.badge-default { background: var(--border); color: var(--text-muted); }

/* compare checkbox */
.compare-check {
  position: absolute; top: 10px; right: 14px;
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  user-select: none;
}
.compare-check input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--blue); }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin: 14px 0 10px; }
.card-title { font-size: .95rem; font-weight: 700; margin: 0; line-height: 1.35; padding-right: 32px; }
.card-sub { font-size: 11px; color: var(--text-muted); margin: 2px 0 0; }
.score-circle { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 800; flex-shrink: 0; }
.score-high { background: var(--green-light); color: var(--green-dark); }
.score-mid { background: var(--blue-light); color: #1e40af; }
.score-low { background: var(--yellow-light); color: #92400e; }

.card-price { font-size: 1.2rem; font-weight: 800; margin: 6px 0 2px; }
.price-orig { font-size: 11px; color: var(--text-muted); text-decoration: line-through; display: inline; }
.price-discount { font-size: 12px; color: var(--green); font-weight: 700; }

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag-green { background: var(--green-light); color: var(--green-dark); }
.tag-blue { background: var(--blue-light); color: #1e40af; }
.tag-yellow { background: var(--yellow-light); color: #92400e; }
.tag-red { background: var(--red-light); color: #991b1b; }
.tag-gray { background: var(--border); color: var(--text-muted); }

.usecase-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.usecase-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.uc-ok  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.uc-no  { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; opacity: .45; }

/* score breakdown bars */
.score-breakdown { margin: 10px 0 8px; }
.sb-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.sb-row > span:first-child { width: 82px; flex-shrink: 0; }
.sbar-wrap { flex: 1; height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.sbar-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.sb-val { width: 36px; text-align: right; flex-shrink: 0; font-weight: 600; }

.card-specs { font-size: 12px; color: var(--text-soft); line-height: 1.8; margin-top: 8px; }
.card-warning { font-size: 11px; background: var(--yellow-light); border-left: 3px solid #f59e0b; padding: 6px 10px; margin: 8px 0; border-radius: 0 6px 6px 0; color: #92400e; }

.card-link { display: block; margin-top: 14px; text-align: center; padding: 9px; background: var(--blue); color: white; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 600; transition: background .15s; }
.card-link:hover { background: #1d4ed8; }

/* ── table ── */
.table-section { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 28px; }
.table-section-head { padding: 20px 24px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #f8fafc; text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:hover td { background: #f8fafc; }
.td-rank { font-weight: 700; color: var(--text-muted); }
.td-brand { font-weight: 600; }
.td-price { font-weight: 700; }
.td-price small { display: block; text-decoration: line-through; color: var(--text-muted); font-size: 11px; font-weight: 400; }
.td-score { font-weight: 800; font-size: 1.05rem; text-align: center; }
.fit-excellent { color: var(--green); font-weight: 600; }
.fit-good { color: var(--blue); font-weight: 600; }
.fit-maybe { color: var(--yellow); }
.fit-discard { color: var(--red); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.no-results { padding: 60px; text-align: center; color: var(--text-muted); font-size: 1rem; }

/* ── disclaimer ── */
.disclaimer { background: white; border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); font-size: 13px; color: var(--text-soft); line-height: 1.7; }

/* ── compare bar (fixed bottom) ── */
#compareBar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1e3a5f; color: white;
  padding: 14px 24px; display: flex; align-items: center; gap: 14px;
  z-index: 100; box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
#compareBar span { font-size: 14px; }
.cmp-btn-open { padding: 8px 20px; background: white; color: #1e3a5f; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.cmp-btn-open:hover { background: #e2e8f0; }
.cmp-btn-clear { padding: 8px 14px; background: rgba(255,255,255,.15); color: white; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; margin-left: auto; }
.cmp-btn-clear:hover { background: rgba(255,255,255,.25); }

/* ── compare modal ── */
#compareModal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.compare-box {
  background: white; border-radius: var(--radius);
  width: 100%; max-width: 900px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.compare-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1rem; flex-shrink: 0;
}
.close-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.close-btn:hover { color: var(--text); }
.compare-wrap { overflow: auto; padding: 0 0 16px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th { background: #f8fafc; padding: 12px 16px; text-align: center; border-bottom: 2px solid var(--border); font-size: 13px; }
.compare-table th:first-child { text-align: left; }
.compare-table td { padding: 9px 16px; border-bottom: 1px solid #f1f5f9; }
.compare-label { color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.compare-table td:not(:first-child) { text-align: center; }
.compare-best { color: var(--green); font-weight: 700; }
.compare-bold { font-weight: 800; font-size: 1.05rem; background: #f8fafc; }

@media (max-width: 640px) {
  header { padding: 16px; }
  header h1 { font-size: 1.2rem; }
  .header-stats { display: none; }
  main { padding: 16px 12px 80px; }
  .filters { flex-direction: column; }
  .filters input, .filters select { width: 100%; }
  .scenario-grid { grid-template-columns: 1fr; }
}
