:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #5a6775;
  --brand: #0e7490;
  --brand-dark: #155e75;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --warn: #ca8a04;
  --danger: #dc2626;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}
.logo { font-size: 20px; font-weight: 800; color: var(--ink); text-decoration: none; }
.logo span { color: var(--brand); font-weight: 600; }
.site-header nav a { margin-left: 18px; text-decoration: none; color: var(--muted); font-weight: 600; }
.site-header nav a:hover { color: var(--brand); }

/* Layout */
.container { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }

.hero { padding: 40px 8px 24px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; }
.lead { font-size: 18px; color: var(--muted); margin: 0; }

.tool-hero h1 { font-size: 30px; margin: 0 0 8px; }
.cpt-hero { padding: 24px 0 8px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-top: 20px;
}
.card h2 { margin-top: 0; font-size: 20px; }

/* Badges */
.badge {
  display: inline-block;
  background: #e0f2fe;
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  margin-right: 6px;
}
.badge-warn { background: #fef3c7; color: #92400e; }

/* Form / inputs */
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
input[type="text"], input[type="number"], input[type="search"], select {
  flex: 1 1 180px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }

/* Search results */
.search-results { margin-top: 14px; }
.result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 8px;
  background: #fff;
  transition: border-color 0.15s;
}
.result:hover { border-color: var(--brand); }
.result-code { font-weight: 800; color: var(--brand); width: 90px; flex-shrink: 0; }
.result-name { flex: 1; }
.result-cost { color: var(--muted); font-size: 13px; }

/* Denial list */
.denial-list { padding-left: 20px; }
.denial-list li { margin-bottom: 10px; }

/* Chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f1f5f9;
  text-decoration: none;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
}
.chip small { font-weight: 500; color: var(--muted); }
.chip-more { border-style: dashed; background: #fff; }

/* Denial-code pages */
.official-quote {
  font-style: italic;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin: 10px 0;
}
.verdict-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}
.verdict-appealable { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.verdict-not-appealable { background: #f1f5f9; color: #475569; border: 1px solid var(--border); }

/* Result box */
.result-box { margin-top: 14px; padding: 16px 18px; border-radius: 8px; border: 1px solid var(--border); }
.result-box.ok { background: #f0fdf4; border-color: #bbf7d0; }
.result-box.warn { background: #fffbeb; border-color: #fde68a; }
.result-box.red { background: #fef2f2; border-color: #fecaca; }
.result-box h3 { margin: 0 0 6px; font-size: 16px; }
.result-box p { margin: 6px 0; }
.muted { color: var(--muted); }
.hidden { display: none; }

/* Lead CTA */
.lead-cta {
  background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%);
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  text-align: center;
}
.lead-cta h2 { margin-top: 0; }
.lead-cta.compact { text-align: left; margin-top: 16px; padding: 16px 18px; }

.disclosure { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Appeal builder */
.builder-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
@media (max-width: 720px) { .builder-grid { grid-template-columns: 1fr; } }
.builder-form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.builder-form label input, .builder-form label select { margin-top: 4px; width: 100%; }
.builder-output { min-height: 220px; }

.letter-body {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: #fff; text-align: center; padding: 24px 16px; color: var(--muted); }
.site-footer .disclosure { max-width: 720px; margin: 10px auto 0; }

/* Cost-guide (type) pages */
.cost-guides { margin-top: 22px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.price-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.price-table th, .price-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 15px; vertical-align: top; }
.price-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.price-table .price-low { white-space: nowrap; font-weight: 600; }
.price-table .price-note { color: var(--muted); font-size: 13px; }
.tip-list li { margin-bottom: 8px; line-height: 1.5; }
.faq-item { }

/* Responsive */
@media (max-width: 720px) {
  .hero h1 { font-size: 26px; }
  .tool-hero h1 { font-size: 24px; }
  .site-header { flex-direction: column; gap: 8px; padding: 12px 16px; }
  .site-header nav a { margin-left: 0; margin-right: 16px; }
}

/* Language switcher */
.lang-switch-wrap { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.lang-switch { display: inline-flex; flex-wrap: wrap; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px; }
.lang-switch a { padding: 4px 9px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.lang-switch a:hover { color: var(--brand); }
.lang-switch a.active { background: var(--brand); color: #fff; }

/* RTL (Arabic) tweaks */
[dir="rtl"] .lang-switch-wrap { justify-content: flex-start; }
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .site-header nav a { margin-left: 0; margin-right: 18px; }

