:root {
  --ts-dark: #1a1a2e;
  --ts-darker: #0f0f1e;
  --ts-green: #00c853;
  --ts-green-bg: rgba(0, 200, 83, 0.12);
  --ts-yellow: #ffc107;
  --ts-yellow-bg: rgba(255, 193, 7, 0.12);
  --ts-red: #ff3d00;
  --ts-red-bg: rgba(255, 61, 0, 0.12);
  --ts-blue: #2979ff;
  --ts-purple: #7c4dff;
  --text-dark: #1a1a2e;
  --text-medium: #4a4a6a;
  --text-light: #8888a8;
  --bg-white: #ffffff;
  --bg-soft: #f8f8fc;
  --bg-card: #ffffff;
  --border: #e5e7f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark); background: var(--bg-white); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

a { color: var(--ts-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; height: 68px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; color: var(--ts-dark); text-decoration: none;
}
.nav-brand span { color: var(--ts-blue); }
.nav-brand .tagline {
  font-size: 13px; color: var(--text-light); font-weight: 500;
  white-space: nowrap; border-left: 1px solid var(--border); padding-left: 10px;
}
.nav-brand .tagline sup { font-size: 8px; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-medium); transition: all 0.2s;
}
.nav-link:hover { background: var(--bg-soft); text-decoration: none; color: var(--text-dark); }
.nav-link.primary { background: var(--ts-dark); color: white; }
.nav-link.primary:hover { background: #2a2a3e; }

.hero {
  padding: 140px 24px 60px; text-align: center;
  background: linear-gradient(180deg, #f0f0ff 0%, var(--bg-white) 100%);
}
.hero h1 {
  font-size: 52px; font-weight: 800; letter-spacing: -1.5px;
  line-height: 1.1; margin-bottom: 16px; color: var(--ts-dark);
}
.hero h1 em { font-style: normal; color: var(--ts-blue); }
.hero .subtitle {
  font-size: 19px; color: var(--text-medium); max-width: 540px;
  margin: 0 auto 40px; line-height: 1.5;
}

.search-box {
  max-width: 600px; margin: 0 auto; position: relative;
}
.search-box input {
  width: 100%; padding: 18px 24px; padding-right: 56px;
  font-size: 17px; border: 2px solid var(--border); border-radius: var(--radius-lg);
  background: white; outline: none; transition: border-color 0.2s;
  box-shadow: var(--shadow-md);
}
.search-box input:focus { border-color: var(--ts-blue); }
.search-box input::placeholder { color: var(--text-light); }
.search-box button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--ts-dark); color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  transition: background 0.2s;
}
.search-box button:hover { background: #2a2a3e; }

.search-results {
  max-width: 600px; margin: 16px auto 0; text-align: left;
}
.search-result-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: white; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer;
  transition: all 0.2s; text-decoration: none; color: inherit;
}
.search-result-item:hover {
  border-color: var(--ts-blue); box-shadow: var(--shadow-md); text-decoration: none;
}
.search-result-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.search-result-info p { font-size: 13px; color: var(--text-light); }
.search-result-score { text-align: right; }
.search-result-score .rebuy-value {
  font-size: 22px; font-weight: 800; line-height: 1;
}
.search-result-score .rebuy-label {
  font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px;
}

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-light);
  font-size: 15px;
}

.scores-section { padding: 60px 24px; }
.scores-section h2 {
  font-size: 28px; font-weight: 700; margin-bottom: 32px; text-align: center;
}

.how-it-works {
  padding: 80px 24px; background: var(--bg-soft);
}
.how-it-works h2 {
  font-size: 32px; font-weight: 800; text-align: center; margin-bottom: 48px;
}
.metrics-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: 960px; margin: 0 auto;
}
.metric-card {
  background: white; border-radius: var(--radius-lg); padding: 32px;
  border: 1px solid var(--border); text-align: center;
}
.metric-card .metric-icon {
  width: 64px; height: 64px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; margin: 0 auto 16px;
  font-size: 28px;
}
.metric-card .metric-icon.rebuy { background: var(--ts-green-bg); }
.metric-card .metric-icon.stick { background: var(--ts-yellow-bg); }
.metric-card .metric-icon.verdict { background: var(--ts-blue); color: white; background: linear-gradient(135deg, var(--ts-blue), var(--ts-purple)); }
.metric-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.metric-card p { font-size: 14px; color: var(--text-medium); line-height: 1.5; }
.metric-card .formula {
  margin-top: 12px; padding: 8px 16px; background: var(--bg-soft);
  border-radius: var(--radius-sm); font-family: 'SF Mono', monospace;
  font-size: 13px; color: var(--text-medium);
}

.product-page { padding: 100px 24px 60px; }
.product-header {
  max-width: 800px; margin: 0 auto 40px;
}
.product-breadcrumb {
  font-size: 13px; color: var(--text-light); margin-bottom: 16px;
}
.product-breadcrumb a { color: var(--ts-blue); }
.product-title { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.product-meta { font-size: 15px; color: var(--text-medium); }

.score-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 800px; margin: 0 auto 40px;
}
.score-card {
  background: white; border-radius: var(--radius-lg); padding: 28px;
  border: 1px solid var(--border); text-align: center;
  box-shadow: var(--shadow-sm);
}
.score-card.hero-card {
  border-width: 2px; box-shadow: var(--shadow-md);
}
.score-card .score-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-light); font-weight: 600; margin-bottom: 8px;
}
.score-card .score-value {
  font-size: 48px; font-weight: 800; line-height: 1;
  margin-bottom: 4px;
}
.score-card .score-detail {
  font-size: 13px; color: var(--text-medium); margin-top: 8px;
}
.score-value.green { color: var(--ts-green); }
.score-value.yellow { color: var(--ts-yellow); }
.score-value.red { color: var(--ts-red); }

.verdict-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: var(--radius-xl);
  font-size: 16px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px;
}
.verdict-badge.buy_it { background: var(--ts-green-bg); color: var(--ts-green); }
.verdict-badge.consider { background: var(--ts-yellow-bg); color: #e6a800; }
.verdict-badge.skip_it { background: var(--ts-red-bg); color: var(--ts-red); }

.benchmark-section {
  max-width: 800px; margin: 0 auto 40px;
}
.benchmark-card {
  background: var(--bg-soft); border-radius: var(--radius-lg); padding: 24px 28px;
  border: 1px solid var(--border);
}
.benchmark-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.benchmark-bar {
  height: 8px; background: #e5e7f0; border-radius: 4px; position: relative;
  margin-bottom: 8px;
}
.benchmark-fill {
  height: 100%; border-radius: 4px; position: absolute; left: 0; top: 0;
  transition: width 0.6s ease;
}
.benchmark-marker {
  position: absolute; top: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ts-dark); border: 3px solid white; box-shadow: var(--shadow-sm);
  transform: translateX(-50%); transition: left 0.6s ease;
}
.benchmark-labels {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--text-light);
}

.similar-section {
  max-width: 800px; margin: 0 auto 40px;
}
.similar-section h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
}
.similar-list { display: flex; flex-direction: column; gap: 8px; }

.confidence-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.confidence-track {
  flex: 1; height: 4px; background: #e5e7f0; border-radius: 2px; overflow: hidden;
}
.confidence-fill { height: 100%; border-radius: 2px; background: var(--ts-blue); }
.confidence-label { font-size: 11px; color: var(--text-light); white-space: nowrap; }

.price-info {
  max-width: 800px; margin: 0 auto 40px;
}
.price-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.price-card {
  background: white; border-radius: var(--radius-md); padding: 20px;
  border: 1px solid var(--border); text-align: center;
}
.price-card .price-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); margin-bottom: 4px;
}
.price-card .price-amount {
  font-size: 24px; font-weight: 700;
}

.cta-section {
  padding: 80px 24px; text-align: center; background: var(--ts-dark); color: white;
}
.cta-section h2 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.cta-section p { font-size: 17px; opacity: 0.7; margin-bottom: 32px; max-width: 480px; margin-left: auto; margin-right: auto; }
.cta-btn {
  display: inline-block; padding: 14px 36px; border-radius: var(--radius-md);
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: all 0.2s;
}
.cta-btn.primary { background: var(--ts-blue); color: white; }
.cta-btn.primary:hover { background: #1565c0; text-decoration: none; }

.footer {
  padding: 40px 24px; border-top: 1px solid var(--border); text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 12px; }
.footer-links a { font-size: 14px; color: var(--text-light); }
.footer-copy { font-size: 13px; color: var(--text-light); }
.footer-family {
  margin-top: 16px; font-size: 12px; color: var(--text-light);
}
.footer-family a { color: var(--ts-blue); margin: 0 6px; }

.loading-spinner {
  display: flex; justify-content: center; padding: 40px;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--ts-blue); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.data-note {
  max-width: 600px; margin: 24px auto 0; padding: 16px 20px;
  background: var(--bg-soft); border-radius: var(--radius-md);
  font-size: 13px; color: var(--text-light); text-align: center;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 34px; }
  .hero .subtitle { font-size: 16px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .score-cards { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .nav-links .nav-link:not(.primary) { display: none; }
}
