:root {
  --bg: #f5f3ef;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6560;
  --navy: #1a2f45;
  --green: #1e6b4a;
  --gold: #a67c3d;
  --border: #e5e0d8;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 2rem 1rem 4rem;
  max-width: 640px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Summary bar */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.summary-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.summary-item.best {
  border-color: #c5d9c8;
  background: #f4f9f6;
}

.summary-item .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.summary-item .value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.summary-item .detail {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Cards */
main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card.highlight {
  border-color: #b8d4c0;
  box-shadow: 0 4px 24px rgba(30, 107, 74, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.best-tag {
  background: #e6f4ec;
  color: var(--green);
}

.card-top h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.model {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.qty {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  background: #f0ece6;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Pricing */
.pricing {
  margin-bottom: 1rem;
}

.total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.total span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.per-unit {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green);
  margin-top: 0.15rem;
}

.per-unit span {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Repair */
.repair {
  background: #faf7f2;
  border-left: 3px solid var(--gold);
  padding: 0.55rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

/* Seller info */
.seller {
  background: #f8f6f2;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.1rem;
}

.seller-name {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.seller-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Button */
.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.4rem;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover {
  background: #122536;
  transform: translateY(-1px);
}

/* Specs */
.specs {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.92rem;
  border-bottom: 1px solid #f2efe9;
}

.row:last-child {
  border-bottom: none;
}

.row span:first-child {
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.row span:last-child {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: right;
}

/* Help button */
.help {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #ebe7e0;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.help:hover {
  background: var(--navy);
  color: white;
}

/* Tooltip */
.tooltip {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.25rem;
}

.tooltip[hidden] {
  display: none;
}

.tooltip-box {
  background: white;
  border-radius: 14px;
  max-width: 360px;
  width: 100%;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

#tip-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  padding-right: 1.5rem;
}

#tip-body {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
}

/* Suggestion */
.suggestion {
  background: #f4f9f6;
  border: 1px solid #c5d9c8;
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.suggestion h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e6b4a;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.suggestion p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1a1a1a;
}

/* Resources / Parts */
.resources {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}

.resources h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.resources-intro {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.resource-group {
  margin-bottom: 1.1rem;
}

.resource-group:last-child {
  margin-bottom: 0;
}

.resource-group h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resource-links a {
  display: inline-block;
  background: #f0ece6;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.resource-links a:hover {
  background: var(--navy);
  color: #fff;
}

/* Mobile */
@media (max-width: 520px) {
  .summary {
    grid-template-columns: 1fr;
  }
  .summary-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    text-align: left;
    padding: 0.85rem 1rem;
  }
  .summary-item .label {
    width: 100%;
    margin-bottom: 0;
  }
  .card-top {
    flex-direction: column;
    gap: 0.6rem;
  }
  .total {
    font-size: 1.35rem;
  }
}
