/* =========================================================================
   COMPONENTS: cards, pills, buttons, banners, list rows
   ========================================================================= */
.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card .sub { color: var(--muted); font-size: 13px; }

.pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad  { background: var(--bad-soft);  color: var(--bad); }
.pill.brand { background: var(--brand-primary-soft); color: var(--brand-primary); }

.btn {
  display: block; width: 100%; padding: 14px; border: none; cursor: pointer;
  border-radius: 14px; font: inherit; font-size: 15px; font-weight: 700;
}
.btn.primary { background: var(--brand-primary); color: #fff; }
.btn.ghost {
  background: none; color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
}
.btn + .btn { margin-top: 10px; }

.banner {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  font-size: 13.5px; line-height: 1.45;
}
.banner.warn { background: var(--warn-soft); color: #7a4b00; }
.banner.good { background: var(--good-soft); color: #0d6b38; }

.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .label { font-size: 13.5px; }
.row .value { font-size: 13.5px; font-weight: 700; }

.why-line {
  font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 6px;
}

/* Segmented control: ranking style chips */
.seg {
  display: flex; gap: 6px; margin: 10px 0 14px;
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 0 0 auto; padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2);
  font: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg button.active {
  background: var(--brand-primary); border-color: var(--brand-primary);
  color: #fff;
}

/* Reliability pill is tappable; detail shows the math */
.pill.tappable { border: none; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.reli-detail {
  margin-top: 10px; padding: 11px 13px; border-radius: 12px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.reli-detail .reli-source {
  font-weight: 800; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 6px; color: var(--ink);
}
.reli-detail .reli-line { margin-top: 3px; }

/* Toggle switch */
.toggle {
  position: relative; width: 36px; height: 20px; flex-shrink: 0;
  border: none; border-radius: 999px; background: #cdd3e0;
  cursor: pointer; transition: background 0.18s ease; padding: 0;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: left 0.18s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle.on { background: var(--good); }
.toggle.on::after { left: 18px; }

.option-card { position: relative; }
.option-card.recommended {
  border: 2px solid var(--brand-primary);
  box-shadow: var(--shadow);
}
.option-card .reco-tag {
  position: absolute; top: -10px; left: 14px;
  background: var(--brand-primary); color: #fff;
  font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
}
