/* templates-fixes.css — patch file for HTML/CSS naming gaps in v1 dist.
   Loaded AFTER templates.css to override / add missing selectors. */

/* ─── Breadcrumb (used on all templates, was undefined) ───────── */
.breadcrumb {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-muted);
  padding: 24px 0 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-faint); }
.breadcrumb > span:last-child { color: var(--heading); }

/* ─── broker-profile.html — actual HTML uses BEM naming ──────── */
.profile-page { padding-top: 8px; }
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: block;
}
.profile-card__head {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-logo {
  width: 96px; height: 96px; border-radius: 16px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: 'Manrope', sans-serif;
  font-size: 22px; font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
}
.profile-titles { min-width: 0; }
.profile-titles h1 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(28px, 3.4vw, 44px);
  margin: 6px 0 6px;
  color: var(--heading);
  line-height: 1.1;
}
.profile-titles .lede {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 720px;
  margin: 0;
}
.profile-titles .lede b { color: var(--text); font-weight: 600; }
.rating-row {
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-muted);
  flex-wrap: wrap;
}
.rating-row .stars { color: var(--accent); letter-spacing: 1px; font-size: 14px; }
.rating-row .stars .half { opacity: .35; }
.rating-row b { color: var(--heading); font-weight: 700; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.profile-stats > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-stats .lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.profile-stats .val {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  color: var(--heading);
  font-weight: 700;
  letter-spacing: -.01em;
  word-break: break-word;
}
@media (max-width: 1100px) {
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .profile-card { padding: 24px; }
  .profile-card__head { grid-template-columns: 64px 1fr; gap: 16px; }
  .profile-logo { width: 64px; height: 64px; font-size: 16px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ─── pros/cons block (used on broker-profile + comparison) ───── */
.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 40px 0;
}
.proscons .pros, .proscons .cons,
.proscons-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.proscons h3,
.proscons-col h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 14px;
  color: var(--heading);
}
.proscons ul,
.pros-list, .cons-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.proscons li,
.pros-list li, .cons-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; line-height: 1.5; color: var(--text);
}
.proscons .check, .pros-list .check {
  flex: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(22, 199, 132, .15); color: var(--up);
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700;
  margin-top: 2px;
}
.proscons .x, .cons-list .x {
  flex: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(240, 68, 56, .15); color: var(--down);
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700;
  margin-top: 2px;
}
@media (max-width: 720px) {
  .proscons { grid-template-columns: 1fr; gap: 16px; }
}

/* ─── Key Facts Grid (kfg) — used in broker-profile ──────────── */
.kfg-section { margin: 40px 0; }
.kfg-section h2 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(22px, 2.6vw, 32px);
  margin: 6px 0 20px;
  color: var(--heading);
}
.kfg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.kfg > div {
  padding: 20px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.kfg > div:nth-child(4n) { border-right: 0; }
.kfg > div:nth-last-child(-n+4):nth-child(n+5) { border-bottom: 0; }
.kfg-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em;
}
.kfg-val {
  font-family: 'Manrope', sans-serif;
  font-size: 18px; color: var(--heading);
  font-weight: 700;
  letter-spacing: -.01em;
}
@media (max-width: 900px) {
  .kfg { grid-template-columns: repeat(2, 1fr); }
  .kfg > div { border-right: 1px solid var(--border) !important; border-bottom: 1px solid var(--border) !important; }
  .kfg > div:nth-child(2n) { border-right: 0 !important; }
  .kfg > div:nth-last-child(-n+2) { border-bottom: 0 !important; }
}
@media (max-width: 480px) {
  .kfg { grid-template-columns: 1fr; }
  .kfg > div { border-right: 0 !important; }
}

/* ─── Glossary search (was undefined → SVG ballooned) ────────── */
.glossary-search {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 18px;
  max-width: 560px;
  margin: 16px 0 0;
}
.glossary-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.glossary-search svg {
  width: 18px; height: 18px;
  flex: none;
  color: var(--text-muted);
}
.glossary-search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  font-family: inherit; font-size: 15px;
  color: var(--text);
}
.glossary-search input::placeholder { color: var(--text-faint); }

.term-lede { color: var(--text-muted); font-size: 15px; line-height: 1.6; max-width: 720px; }

/* ─── article.html — HTML uses article-grid / article-main ─── */
.article-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  margin: 24px 0 64px;
}
.article-main {
  min-width: 0;
  max-width: 760px;
}
.article-main > h1 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(28px, 3.6vw, 44px);
  margin: 6px 0 12px;
  color: var(--heading);
  line-height: 1.15;
}
.article-main > .lede {
  font-size: 18px; line-height: 1.65; color: var(--text-muted);
  margin: 0 0 24px;
}
.article-main h2 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(22px, 2.6vw, 28px);
  margin: 40px 0 12px;
  color: var(--heading);
}
.article-main h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 18px; margin: 28px 0 10px;
  color: var(--heading);
}
.article-main p { margin: 0 0 14px; line-height: 1.75; }
.article-main ul, .article-main ol {
  margin: 0 0 16px; padding-left: 22px;
}
.article-main li { margin-bottom: 6px; line-height: 1.65; }
.article-main blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  font-style: italic;
  color: var(--text-muted);
}
.article-main code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .92em;
  background: var(--bg-card-2);
  padding: 2px 6px; border-radius: 4px;
  color: var(--accent);
}
.article-main pre {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  margin: 14px 0 18px;
}
.article-main pre code { background: transparent; padding: 0; color: var(--text); }

@media (max-width: 1100px) {
  .article-grid { grid-template-columns: 1fr; gap: 16px; }
  .article-toc { position: static; max-height: 280px; overflow-y: auto; }
}

.toc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint);
  margin: 0 0 8px;
}

.callout {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 10px;
  border-left: 3px solid var(--text-muted);
  background: var(--bg-card);
  font-size: 14px; line-height: 1.6;
}
.callout--note { border-left-color: var(--accent); background: var(--accent-soft); }
.callout--warning { border-left-color: var(--warn, #F0A23B); background: rgba(240, 162, 59, .08); }
.callout b { color: var(--heading); }

.key-takeaway-aside,
.key-takeaways {
  margin: 32px 0;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.key-takeaway-aside h3,
.key-takeaways h3 {
  margin: 0 0 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--heading);
}
.kt-label, .cl-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
}

.article-byline,
.byline,
.meta-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-muted);
  margin: 12px 0 18px;
  flex-wrap: wrap;
}
.byline .avatar,
.article-byline .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-card-2);
  display: inline-grid; place-items: center;
  font-weight: 700; font-size: 13px;
  color: var(--text);
  flex: none;
}

/* ─── tools.html — formula + example blocks ─────────────────── */
.formula-block {
  margin: 18px 0;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.formula-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint);
  margin-bottom: 10px;
}
.example-box {
  margin: 18px 0;
  padding: 20px 24px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: 12px;
  font-size: 14px;
}
.example-box b { color: var(--heading); }
.example-box ul { margin: 8px 0 0; padding-left: 20px; }

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.quick-facts > div {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.qf-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-faint);
}
.qf-num {
  font-family: 'Manrope', sans-serif;
  font-size: 22px; color: var(--heading);
  font-weight: 700;
}
@media (max-width: 720px) {
  .quick-facts { grid-template-columns: 1fr; }
}

/* ─── comparison.html — vs cards + cmp-table ───────────────── */
.stack--vs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 24px 0 48px;
}
.vs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.vs-card--verdict {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.vs-head { display: flex; align-items: center; gap: 12px; }
.vs-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 14px;
  flex: none;
}
.vs-logo--alt { background: var(--text-muted); color: var(--bg); }
.vs-titles {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.vs-titles strong {
  font-family: 'Manrope', sans-serif;
  font-size: 18px; color: var(--heading);
  letter-spacing: -.01em;
}
.vs-titles small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-faint);
}
.vs-stats {
  list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px;
}
.vs-stats li {
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--text-muted);
}
.vs-stats li b { color: var(--heading); font-weight: 600; }
.vs-proscons {
  font-size: 12px; color: var(--text-muted);
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.verdict-num {
  font-family: 'Manrope', sans-serif;
  font-size: 32px; color: var(--accent);
  font-weight: 800;
}
@media (max-width: 900px) {
  .stack--vs { grid-template-columns: 1fr; }
}

.cmp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}
.cmp-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.cmp-table th, .cmp-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table thead th {
  background: var(--bg-card-2);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--heading);
  position: sticky; top: 0;
  z-index: 1;
}
.cmp-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: normal;
}
.cmp-table .win { color: var(--up); font-weight: 700; }
.cmp-table .hl { color: var(--heading); font-weight: 700; }

.conclusion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}
.conclusion-grid > div {
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.conclusion-grid h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 16px; margin: 0 0 10px;
  color: var(--heading);
}
@media (max-width: 720px) {
  .conclusion-grid { grid-template-columns: 1fr; }
}

/* ─── ratings + tags ─────────────────────────────────────────── */
.rating-big {
  display: flex; align-items: baseline; gap: 8px;
  font-family: 'Manrope', sans-serif;
}
.stars-big {
  color: var(--accent); font-size: 18px; letter-spacing: 1px;
}
.stars-big .half { opacity: .35; }
.reviews-row {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.muted { color: var(--text-muted); }
.pct { color: var(--up); font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* ─── btn-secondary alias ────────────────────────────────────── */
.btn-secondary {
  background: var(--bg-card);
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--heading) !important;
}
