:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --accent: #f97316;
  --green: #16a34a;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
}

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

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

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

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

/* Nav */
.nav { background: var(--ink); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.3px; line-height: 0; }
.brand span { color: var(--accent); }
.brand img {  padding: 4px 8px; border-radius: 8px; height: 30px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: #cbd5e1; font-size: 14px; font-weight: 500; }
.nav-links a.active { color: #fff; text-decoration: underline; text-underline-offset: 6px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #4c1d95 100%);
  color: #fff;
  padding: 64px 0 72px;
  text-align: center;
}
.hero h1 { font-size: 40px; font-weight: 800; letter-spacing: -1px; max-width: 720px; margin: 0 auto 12px; }
.hero h1 span { color: var(--accent); }
.hero p { color: #c7d2fe; font-size: 17px; max-width: 620px; margin: 0 auto 28px; }

.searchbox { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.searchbox input {
  flex: 1; padding: 14px 18px; border: none; border-radius: 999px;
  font-size: 15px; background: #fff; color: var(--ink);
}
.searchbox button {
  padding: 14px 28px; border: none; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.searchbox button:hover { background: #ea580c; }

.chips { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.chips a {
  padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3);
  color: #e0e7ff; font-size: 13px;
}
.chips a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(15, 23, 42, .12); }
.card h3 { font-size: 16px; line-height: 1.35; }
.card .cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.card .price { font-size: 20px; font-weight: 800; color: var(--primary); }
.card .store { font-size: 12px; color: var(--muted); }
.card .btn { margin-top: auto; }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  background: var(--primary); color: #fff !important; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none !important;
}
.btn:hover { background: var(--primary-dark); }
.btn.block { display: block; text-align: center; }
.btn.outline { background: transparent; border: 1px solid var(--border); color: var(--ink) !important; }
.btn.danger { background: #ef4444; }

/* Page head */
.page { padding: 40px 0 80px; }
.page h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.page .sub { color: var(--muted); margin-bottom: 28px; }

/* Filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.filters input, .filters select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 14px;
}
.filters input[type="text"], .filters input[type="number"] { min-width: 180px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 14px; }
th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr + tr { border-top: 1px solid var(--border); }
.best-row { background: #f0fdf4; }
.rank { font-weight: 700; }
.low { color: var(--green); font-weight: 700; }
.mrp { color: var(--muted); text-decoration: line-through; font-size: 12px; }

/* Specs */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.spec { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.spec .k { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.spec .v { font-weight: 600; font-size: 14px; margin-top: 2px; }

/* Compare */
.cmp-table td, .cmp-table th { width: 19%; }
.cmp-table th:first-child, .cmp-table td:first-child { width: 24%; }

/* Valuation */
.val-form { max-width: 520px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
}
.result-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 24px; margin-top: 24px; }
.result-box .range { font-size: 30px; font-weight: 800; color: var(--green); }
.result-box .exp { color: var(--muted); margin-top: 8px; font-size: 14px; }

/* Chat */
.chat { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-body { padding: 20px; height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; padding: 12px 16px; border-radius: 14px; font-size: 14px; white-space: pre-line; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #f1f5f9; border-bottom-left-radius: 4px; }
.chat-input { display: flex; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; border: none; padding: 16px 18px; font-size: 15px; outline: none; }
.chat-input button { border: none; background: var(--primary); color: #fff; padding: 0 24px; font-weight: 600; cursor: pointer; }
.chat-input button:hover { background: var(--primary-dark); }

/* Misc */
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 0 48px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #dcfce7; color: #15803d; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #ede9fe; color: var(--primary); }

.card-img { width: calc(100% + 40px); margin: -20px -20px 8px; height: 150px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.detail-top { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.detail-img { width: 320px; max-width: 100%; height: 240px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.thumb { width: 90px; height: 68px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 6px; border: 1px solid var(--border); }