:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --brand-primary: #0284c7;
  --brand-dark: #0369a1;
  --accent-green: #16a34a;
  --accent-green-bg: #f0fdf4;
  --accent-blue-bg: #f0f9ff;
  --accent-amber: #d97706;
  --amazon-orange: #ff9900;
  --amazon-dark: #232f3e;
  --danger-red: #dc2626;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px -4px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Owner Preview Bar */
.owner-preview-bar {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #f8fafc;
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 1px solid #334155;
}

.preview-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-owner {
  background: #10b981;
  color: #052e16;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

.btn-preview-toggle {
  background: #38bdf8;
  color: #0f172a;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preview-toggle:hover {
  background: #7dd3fc;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #10b981);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-accent {
  color: var(--accent-green);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tab {
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* AdSense Slots */
.ad-container-top {
  margin-top: 18px;
}

.adsense-slot {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  position: relative;
  transition: all 0.2s ease;
}

.ad-mock-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.ad-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.ad-cta-link {
  color: var(--brand-primary);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Clean Launch Mode (No Display Ads / No Affiliate before account setup) */
body.no-ads-mode .adsense-slot,
body.no-ads-mode .ad-container-top {
  display: none !important;
}

body.no-affiliate-mode .affiliate-showcase {
  display: none !important;
}

/* Highlight mode when user clicks "Làm nổi bật vị trí đặt Quảng cáo & Affiliate" */
body.highlight-monetization .adsense-slot,
body.highlight-monetization .affiliate-showcase {
  outline: 3px solid #f59e0b !important;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.18) !important;
  position: relative;
}

body.highlight-monetization .adsense-slot::before,
body.highlight-monetization .affiliate-showcase::before {
  content: attr(data-ad-label);
  display: block;
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* Main Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 26px;
  margin-top: 22px;
  margin-bottom: 48px;
}

@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.panel-header h1 {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.panel-header p {
  color: var(--text-muted);
  font-size: 14.5px;
}

/* Calculator Card */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

select,
input[type="number"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-main);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

select:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit .unit-prefix {
  position: absolute;
  left: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-with-unit .unit-prefix + input {
  padding-left: 26px;
}

.input-with-unit .unit-suffix {
  position: absolute;
  right: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.btn-inline-chip {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-inline-chip:hover {
  background: #bae6fd;
}

.vehicle-specs-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.spec-pill {
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand-primary);
  cursor: pointer;
  margin-top: 4px;
}

.range-marks {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* KPI Results */
.results-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 720px) {
  .results-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.kpi-card.highlight-green {
  background: var(--accent-green-bg);
  border-color: #bbf7d0;
}

.kpi-card.highlight-blue {
  background: var(--accent-blue-bg);
  border-color: #bae6fd;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.8px;
  line-height: 1.15;
}

.kpi-card.highlight-green .kpi-value {
  color: #15803d;
}

.kpi-card.highlight-blue .kpi-value {
  color: #0369a1;
}

.kpi-value .per-unit,
.kpi-value small {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Speed Comparison Bars */
.speed-comparison-box {
  margin-top: 22px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.speed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.speed-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.speed-badge {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
}

.bar-row {
  margin-bottom: 14px;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.text-danger {
  color: var(--danger-red);
}

.text-success {
  color: var(--accent-green);
}

.progress-track {
  height: 12px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.fill-l1 {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.fill-l2 {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* Affiliate Showcase */
.affiliate-showcase {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 26px;
}

.affiliate-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.affiliate-showcase h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 6px;
}

.affiliate-showcase p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 780px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.product-card.featured {
  border: 2px solid #0284c7;
}

.product-ribbon {
  display: inline-block;
  align-self: flex-start;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.product-ribbon.ribbon-value {
  background: #dcfce7;
  color: #15803d;
}

.product-ribbon.ribbon-tesla {
  background: #fef3c7;
  color: #b45309;
}

.product-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.product-rating {
  color: #f59e0b;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.product-rating span {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

.product-features {
  list-style: none;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.small-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.product-footer {
  margin-top: auto;
}

.price-hint {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.prime-tag {
  font-size: 11.5px;
  color: #0284c7;
  font-weight: 700;
}

.btn-amazon {
  display: block;
  text-align: center;
  background: var(--amazon-orange);
  color: #0f172a;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-amazon:hover {
  background: #f59e0b;
}

.affiliate-disclosure {
  margin-top: 14px;
  margin-bottom: 0 !important;
  font-size: 11.5px !important;
  text-align: center;
}

/* SEO State Comparison Table */
.seo-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.seo-section h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.seo-section p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.table-responsive {
  overflow-x: auto;
}

.state-rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.state-rate-table th,
.state-rate-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.state-rate-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.state-rate-table tr:hover td {
  background: #f0f9ff;
}

/* FAQ & Legal SEO Sections */
.faq-section,
.legal-section {
  margin-top: 24px;
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.faq-item h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.faq-item p {
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.6;
}

.faq-item p:last-child {
  margin-bottom: 0;
}

.faq-item ul {
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faq-item code {
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
}

.legal-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 680px) {
  .legal-cols {
    grid-template-columns: 1fr;
  }
}

.legal-cols h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.legal-cols p {
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Sidebar */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.ad-mock-sidebar {
  text-align: center;
  padding: 20px 10px;
}

.ad-mock-sidebar h4 {
  font-size: 16px;
  margin: 12px 0 8px;
}

.ad-mock-sidebar p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.ad-fake-btn {
  background: var(--brand-primary);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: 8px;
}

.cheat-sheet-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.cheat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.cheat-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.cheat-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cheat-list span {
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 32px 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-note {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 6px;
  max-width: 720px;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.footer-links a {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 600;
}
