@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --hvac-bg: #f8fafc;
  --hvac-surface: #ffffff;
  --hvac-surface-alt: #f1f5f9;
  --hvac-border: #e2e8f0;
  --hvac-border-strong: #cbd5e1;
  --hvac-text: #0f172a;
  --hvac-text-muted: #64748b;
  --hvac-text-dim: #94a3b8;
  --hvac-accent: #1d4ed8;
  --hvac-accent-hover: #1e40af;
  --hvac-brand-dot: #dc2626;
  --hvac-severity-red: #b91c1c;
  --hvac-severity-red-bg: #fef2f2;
  --hvac-severity-yellow: #a16207;
  --hvac-severity-yellow-bg: #fffbeb;
  --hvac-severity-green: #15803d;
  --hvac-severity-green-bg: #f0fdf4;
  --hvac-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --hvac-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --hvac-radius: 10px;
  --hvac-radius-lg: 14px;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', SFMono-Regular, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--hvac-bg);
  color: var(--hvac-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.hvac-app main {
  margin: 0;
  padding: 0;
  flex: 1;
}

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

h1, h2, h3 {
  color: var(--hvac-text);
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container--wide { max-width: 1200px; }

/* ========== NAV ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--hvac-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--hvac-shadow-sm);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 56px;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--hvac-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.navbar-brand:hover { text-decoration: none; color: var(--hvac-text); }
.navbar-brand .dot { color: var(--hvac-brand-dot); }

.navbar-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .navbar-links { display: flex; }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hvac-text-muted);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--hvac-accent);
  text-decoration: none;
}

.nav-search input {
  border: 1px solid var(--hvac-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  width: 140px;
  background: var(--hvac-surface-alt);
  color: var(--hvac-text);
}

.nav-search input:focus {
  outline: 2px solid rgba(29, 78, 216, 0.2);
  border-color: var(--hvac-accent);
  background: var(--hvac-surface);
}

/* ========== HERO / LANDING ========== */
.landing {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  background:
    linear-gradient(180deg, #eef2ff 0%, var(--hvac-bg) 70%);
  border-bottom: 1px solid var(--hvac-border);
}

.landing--results {
  padding: 2rem 0 1.5rem;
}

.landing h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.landing h1 .dot { color: var(--hvac-brand-dot); }

.tagline {
  color: var(--hvac-text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.search-form {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.search-form input[type="search"] {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  font-size: 1rem;
  border: 1px solid var(--hvac-border-strong);
  border-radius: var(--hvac-radius-lg);
  background: var(--hvac-surface);
  box-shadow: var(--hvac-shadow-sm);
  color: var(--hvac-text);
}

.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--hvac-accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.search-form::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-size: contain;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--hvac-surface);
  border: 1px solid var(--hvac-border);
  border-radius: var(--hvac-radius);
  max-height: 320px;
  overflow-y: auto;
  box-shadow: var(--hvac-shadow-md);
  z-index: 100;
  text-align: left;
}

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--hvac-border);
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover {
  background: var(--hvac-surface-alt);
  text-decoration: none;
}

.search-result-item:last-child { border-bottom: none; }

.search-result-label {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--hvac-text-muted);
  margin-top: 2px;
}

.quick-links {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--hvac-text-muted);
  background: var(--hvac-surface);
  border: 1px solid var(--hvac-border);
  border-radius: 999px;
  text-decoration: none;
}

.quick-pill:hover {
  border-color: var(--hvac-accent);
  color: var(--hvac-accent);
  text-decoration: none;
}

/* ========== BRAND CHIPS ========== */
.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.brand-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--hvac-surface);
  border: 1px solid var(--hvac-border);
  border-radius: 6px;
  color: var(--hvac-text);
  text-decoration: none;
}

.brand-chip:hover {
  border-color: var(--hvac-accent);
  color: var(--hvac-accent);
  text-decoration: none;
}

/* ========== PAGE CONTENT ========== */
.page-content {
  padding: 1.5rem 0 2.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.75rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--hvac-border);
}

.content-section { margin: 1.5rem 0; }

/* ========== BREADCRUMB ========== */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--hvac-text-dim);
  padding: 0.75rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumb a { color: var(--hvac-text-muted); }
.breadcrumb a:hover { color: var(--hvac-accent); }
.breadcrumb .sep { margin: 0 0.15rem; opacity: 0.5; }

/* ========== TABLES ========== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hvac-border);
  border-radius: var(--hvac-radius);
  background: var(--hvac-surface);
  box-shadow: var(--hvac-shadow-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}

table.data-table th {
  text-align: left;
  background: var(--hvac-surface-alt);
  border-bottom: 1px solid var(--hvac-border);
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hvac-text-muted);
}

table.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--hvac-border);
  vertical-align: top;
}

table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #fafbfc; }

.code-label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--hvac-accent);
  background: #eff6ff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-decoration: none;
}

.code-label:hover {
  background: #dbeafe;
  text-decoration: none;
}

/* ========== SEVERITY ========== */
.severity-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.severity-red, .severity-badge.severity-red {
  color: var(--hvac-severity-red);
  background: var(--hvac-severity-red-bg);
}

.severity-yellow, .severity-badge.severity-yellow {
  color: var(--hvac-severity-yellow);
  background: var(--hvac-severity-yellow-bg);
}

.severity-green, .severity-badge.severity-green {
  color: var(--hvac-severity-green);
  background: var(--hvac-severity-green-bg);
}

/* legacy class names */
.severity-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ========== CODE DETAIL ========== */
.code-header h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.35;
}

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.meta-list dt {
  font-weight: 600;
  color: var(--hvac-text-muted);
}

.cost-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--hvac-radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.cost-label { font-weight: 500; color: var(--hvac-text-muted); }
.cost-range { font-size: 1.25rem; font-weight: 700; color: var(--hvac-text); }
.cost-note { font-size: 0.8rem; color: var(--hvac-text-dim); }

.hazard-notice {
  background: var(--hvac-severity-red-bg);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--hvac-severity-red);
  border-radius: var(--hvac-radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.fix-list {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.fix-list li {
  margin: 0.5rem 0;
  padding-left: 0.25rem;
}

/* ========== CARDS / LISTS ========== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.link-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--hvac-surface);
  border: 1px solid var(--hvac-border);
  border-radius: var(--hvac-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
  border-color: var(--hvac-accent);
  box-shadow: var(--hvac-shadow-sm);
  text-decoration: none;
}

.link-card-title {
  font-weight: 600;
  color: var(--hvac-text);
}

.link-card-meta {
  font-size: 0.8125rem;
  color: var(--hvac-text-muted);
  margin-top: 0.25rem;
}

.model-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.model-list li { margin: 0.35rem 0; }

.model-family { font-weight: 500; }
.model-fuel {
  font-size: 0.8rem;
  color: var(--hvac-text-dim);
  margin-left: 0.35rem;
}

/* Models index */
.models-index-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 2rem;
}

@media (min-width: 600px) {
  .models-index-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .models-index-grid { grid-template-columns: repeat(3, 1fr); }
}

.models-index-grid .content-section {
  margin: 0;
  padding: 1rem;
  background: var(--hvac-surface);
  border: 1px solid var(--hvac-border);
  border-radius: var(--hvac-radius);
}

.models-index-grid h2 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.models-index-grid .model-list {
  font-size: 0.875rem;
  column-width: 9rem;
  column-gap: 1rem;
}

.models-index-grid .model-list li {
  break-inside: avoid;
  margin: 0.15rem 0;
}

/* Recalls */
.recall-item {
  background: var(--hvac-severity-yellow-bg);
  border: 1px solid #fde68a;
  border-radius: var(--hvac-radius);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}

.recall-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--hvac-text-muted);
  margin-left: 0.5rem;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--hvac-surface);
  border-top: 1px solid var(--hvac-border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}

.footer-brand {
  font-weight: 700;
  color: var(--hvac-text);
  text-decoration: none;
}

.footer-brand .dot { color: var(--hvac-brand-dot); }

.footer-tagline {
  font-size: 0.875rem;
  color: var(--hvac-text-muted);
  margin-top: 0.35rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hvac-text-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--hvac-accent); }

.footer-legal {
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hvac-border);
  color: var(--hvac-text-dim);
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.5;
}

/* Plain lists in results */
.result-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.5rem;
}

.result-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hvac-border);
}

.result-list li:last-child { border-bottom: none; }
