/* Stock & ETF comparison. Uses the site tokens from style.css; scoped to .cmp-page. */

.cmp-page {
  --ca: #38bdf8;
  --cb: #f59e0b;
  --cs: #94a3b8;
  --cmp-line: rgba(148, 163, 184, 0.14);
  --cmp-panel: linear-gradient(180deg, rgba(18, 30, 51, 0.92) 0%, rgba(13, 24, 41, 0.92) 100%);
  color: var(--text-main);
  padding: 28px 0 64px;
  overflow-x: clip;
}
.cmp-page *, .cmp-page *::before, .cmp-page *::after { box-sizing: border-box; }
.cmp-page [hidden] { display: none !important; }
.cmp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.cmp-wrap-narrow { max-width: 820px; }
.cmp-num, .cmp-table td, .cmp-mono { font-variant-numeric: tabular-nums; }
.cmp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95em; }
.cmp-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cmp-page a { color: var(--accent-soft); text-underline-offset: 3px; }
.cmp-page a:focus-visible, .cmp-page button:focus-visible, .cmp-page input:focus-visible,
.cmp-page select:focus-visible, .cmp-page summary:focus-visible {
  outline: 2px solid var(--accent-soft); outline-offset: 2px; border-radius: 6px;
}
.cmp-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.cmp-muted { color: var(--text-muted); }
.cmp-small { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; margin: 12px 0 0; }
.cmp-strong { color: var(--text-main); font-weight: 650; }

.cmp-banner {
  margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-md);
  border: 1px solid rgba(234, 179, 8, 0.35); background: rgba(234, 179, 8, 0.08);
  color: #fde68a; font-size: 14px; line-height: 1.5;
}
.cmp-banner-sample { border-color: rgba(168, 85, 247, 0.45); background: rgba(168, 85, 247, 0.1); color: #e9d5ff; }

/* --------------------------------------------------------------- buttons */
.cmp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card-elevated);
  color: var(--text-main); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
}
.cmp-page a.cmp-btn { color: var(--text-main); }
.cmp-btn-primary { background: var(--accent-gradient); border-color: transparent; color: #04120a; }
.cmp-btn-primary:hover { filter: brightness(1.08); }

/* --------------------------------------------------------------- landing */
.cmp-landing-head { text-align: center; margin: 16px 0 28px; }
.cmp-landing-head h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 14px; }
.cmp-lead { color: var(--text-secondary); font-size: 17px; line-height: 1.6; max-width: 640px; margin: 0 auto; }

.cmp-form {
  background: var(--cmp-panel); border: 1px solid var(--cmp-line); border-radius: var(--radius-xl);
  padding: 24px; box-shadow: var(--shadow-lg);
}
.cmp-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; }
.cmp-field label { display: block; font-weight: 650; font-size: 14px; margin-bottom: 8px; color: var(--text-secondary); }
.cmp-combo { position: relative; }
.cmp-combo input {
  width: 100%; min-height: 48px; padding: 0 14px; font: inherit; font-size: 16px;
  color: var(--text-main); background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cmp-combo input::placeholder { color: var(--text-dim); }
.cmp-swap {
  min-width: 44px; min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card-elevated); color: var(--text-secondary); cursor: pointer; display: grid; place-items: center;
}
.cmp-swap:hover { color: var(--text-main); }
.cmp-submit { width: 100%; margin-top: 16px; min-height: 48px; font-size: 16px; }
.cmp-hint { color: var(--text-muted); font-size: 13.5px; margin: 12px 0 0; }
.cmp-error { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.4); color: #fecaca; font-size: 14px; }
.cmp-suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; max-height: 300px; overflow-y: auto; background: var(--card-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-xl);
}
.cmp-suggest li { display: flex; gap: 10px; align-items: baseline; min-height: 44px; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.cmp-suggest li[aria-selected="true"], .cmp-suggest li:hover { background: rgba(34, 197, 94, 0.12); }
.cmp-suggest b { font-variant-numeric: tabular-nums; min-width: 54px; }
.cmp-suggest span { color: var(--text-muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cmp-suggest em { font-style: normal; font-size: 11px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

.cmp-examples { margin: 32px 0; }
.cmp-examples h2, .cmp-explain h2 { font-size: 18px; margin: 0 0 14px; }
.cmp-examples ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cmp-examples a {
  display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px;
  border-radius: var(--radius-md); border: 1px solid var(--cmp-line); background: var(--card);
  color: var(--text-main); text-decoration: none; font-weight: 650;
}
.cmp-page .cmp-examples a { color: var(--text-main); }
.cmp-examples a:hover { border-color: var(--border-accent); background: var(--card-hover); }
.cmp-vs { color: var(--text-muted); font-weight: 500; margin: 0 4px; }
.cmp-examples svg { color: var(--accent-soft); }
.cmp-explain dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.cmp-explain dl > div { padding: 16px; border: 1px solid var(--cmp-line); border-radius: var(--radius-md); background: var(--card); }
.cmp-explain dt { font-weight: 700; margin-bottom: 6px; }
.cmp-explain dd { margin: 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.55; }

/* ------------------------------------------------------------- pair page */
.cmp-crumbs { font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; }
.cmp-crumbs a { color: var(--text-muted); }
.cmp-pair-head h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 16px; }
.cmp-assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 720px; }
.cmp-asset { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--cmp-line); border-top: 3px solid var(--c); min-width: 0; }
.cmp-asset > div { min-width: 0; }
.cmp-asset-ticker { margin: 0; font-weight: 750; font-size: 18px; }
.cmp-page .cmp-asset-ticker a { color: var(--text-main); text-decoration: none; }
.cmp-asset-ticker a:hover { text-decoration: underline; }
.cmp-asset-name { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.cmp-type { font-size: 11px; font-weight: 650; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; vertical-align: 3px; margin-left: 4px; }
.cmp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; margin-top: 7px; }
.cmp-dash { display: inline-block; width: 14px; height: 0; border-top: 2px dashed var(--cs); vertical-align: middle; margin-right: 6px; }
.cmp-asof { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 14px 0 20px; color: var(--text-muted); font-size: 14px; }
.cmp-sep { color: var(--text-dim); }
.cmp-asof .cmp-sep:first-child { display: none; }

.cmp-card {
  background: var(--cmp-panel); border: 1px solid var(--cmp-line); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 18px; min-width: 0;
}
.cmp-card h2 { font-size: 21px; letter-spacing: -0.015em; line-height: 1.35; margin: 0 0 14px; }
.cmp-card h3 { font-size: 15px; margin: 0 0 6px; }
.cmp-state p { color: var(--text-secondary); }

.cmp-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.cmp-answer { margin: 0; display: flex; flex-direction: column; }
.cmp-answer h2 { font-size: 19px; font-weight: 650; min-height: 3.9em; }
.cmp-values { display: grid; gap: 8px; margin-top: auto; border-top: 1px solid var(--cmp-line); padding-top: 14px; }
.cmp-values-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmp-values-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cmp-value { min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(6, 11, 24, 0.45); border: 1px solid transparent; }
.cmp-value.is-lead { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 9%, rgba(6, 11, 24, 0.45)); }
.cmp-value-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.cmp-value-label .cmp-dot { margin: 0; width: 8px; height: 8px; }
.cmp-value-label small { font-weight: 500; color: var(--text-dim); }
.cmp-value strong { display: block; font-size: clamp(18px, 2.6vw, 26px); font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; overflow-wrap: anywhere; }
.cmp-value-bench strong { color: var(--text-secondary); }
.cmp-lead-tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c); }

.cmp-changed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cmp-changed-grid > div { min-width: 0; }
.cmp-changed-grid p { margin: 0 0 6px; color: var(--text-secondary); line-height: 1.55; }
.cmp-history { margin-top: 12px; border: 1px solid var(--cmp-line); border-radius: var(--radius-sm); }
.cmp-history summary { cursor: pointer; padding: 12px 14px; min-height: 44px; font-size: 14px; font-weight: 650; color: var(--text-secondary); }
.cmp-history[open] summary { border-bottom: 1px solid var(--cmp-line); }
.cmp-history .cmp-table-wrap { padding: 4px 6px 8px; }

.cmp-table-wrap { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp-table caption { text-align: left; color: var(--text-muted); font-size: 13px; padding: 0 0 10px; }
.cmp-table th, .cmp-table td { padding: 10px 10px; border-bottom: 1px solid var(--cmp-line); text-align: right; white-space: nowrap; }
.cmp-table th:first-child { text-align: left; }
.cmp-table thead th { color: var(--text-muted); font-weight: 650; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.cmp-table tbody th { font-weight: 600; color: var(--text-secondary); }
.cmp-table tr.is-current { background: rgba(34, 197, 94, 0.07); }
.cmp-table tr.is-current th { color: var(--accent-soft); }
.cmp-table tr.is-flip td:last-child { color: #fde68a; font-weight: 650; }
.cmp-insufficient { text-align: left !important; color: var(--text-muted); white-space: normal !important; }
.cmp-col-dates { color: var(--text-muted); font-size: 13px; }
.cmp-table-history th, .cmp-table-history td { padding: 8px; font-size: 13px; }

.cmp-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cmp-chart-head h2 { margin: 0; }
.cmp-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cmp-seg { display: inline-flex; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.cmp-seg button {
  min-width: 44px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text-secondary); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
}
.cmp-seg button[aria-pressed="true"] { background: var(--card-elevated); color: var(--text-main); box-shadow: inset 0 0 0 1px var(--border-accent); }
.cmp-seg button:disabled { color: var(--text-dim); cursor: not-allowed; }
.cmp-select { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted); }
.cmp-select select, .cmp-calc-input input {
  min-height: 44px; padding: 0 12px; font: inherit; color: var(--text-main); background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.cmp-legend { list-style: none; display: flex; gap: 16px; flex-wrap: wrap; padding: 0; margin: 10px 0; font-size: 13.5px; color: var(--text-secondary); font-weight: 600; }
.cmp-legend li { display: flex; align-items: center; gap: 6px; }
.cmp-swatch { width: 18px; height: 3px; border-radius: 2px; background: var(--c); }
.cmp-swatch-dash { background: none; border-top: 2px dashed var(--cs); height: 0; border-radius: 0; }
.cmp-chart { position: relative; height: 320px; margin: 8px 0 0; }
.cmp-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cmp-chart-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.cmp-chart .cmp-grid line { stroke: var(--cmp-line); }
.cmp-chart .cmp-axis text { fill: var(--text-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.cmp-chart .cmp-zero { stroke: rgba(148, 163, 184, 0.35); }
.cmp-chart-tip {
  position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: var(--card-elevated);
  border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow-md); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cmp-calc-input { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.cmp-calc-input label { font-weight: 650; font-size: 14px; color: var(--text-secondary); }
.cmp-calc-input input { width: 180px; }

.cmp-trust dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.cmp-trust dt { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.cmp-trust dd { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
  .cmp-answers, .cmp-changed-grid, .cmp-trust dl, .cmp-explain dl { grid-template-columns: 1fr; }
  .cmp-answer h2 { min-height: 0; }
  .cmp-chart { height: 240px; }
}
@media (max-width: 560px) {
  .cmp-page { padding-top: 16px; }
  .cmp-wrap { padding: 0 14px; }
  .cmp-card, .cmp-form { padding: 16px; }
  .cmp-fields { grid-template-columns: 1fr; }
  .cmp-swap { justify-self: center; min-height: 44px; transform: rotate(0deg); }
  .cmp-assets { gap: 8px; }
  .cmp-asset { padding: 10px; }
  .cmp-asset-ticker { font-size: 16px; }
  .cmp-value { padding: 8px; }
  .cmp-value-label { font-size: 12px; }
  .cmp-value-label small { display: none; }
  .cmp-value strong { font-size: 16px; white-space: nowrap; letter-spacing: -0.03em; }
  .cmp-lead-tag { font-size: 10px; }
  .cmp-answer h2 { font-size: 17px; }
  .cmp-table th, .cmp-table td { padding: 8px 6px; font-size: 13px; }
  .cmp-col-dates { display: none; }
  .cmp-seg button { min-width: 40px; padding: 0 6px; font-size: 13px; }
  .cmp-controls { width: 100%; }
  .cmp-seg { width: 100%; justify-content: space-between; }
}

/* Follow box, paid metrics and the followed-pairs page */
.cmp-follow { padding-top: 16px; padding-bottom: 16px; }
.cmp-follow-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.cmp-follow-row .cmp-small { margin: 0; flex: 1 1 280px; }
.cmp-follow-state { margin: 0; flex: 1 1 320px; line-height: 1.5; }
.cmp-follow-choices { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.cmp-follow fieldset { border: 1px solid var(--cmp-line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 10px; display: grid; gap: 6px; }
.cmp-follow legend { font-weight: 650; padding: 0 4px; }
.cmp-notice { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.35); }
.cmp-subhead { margin-top: 22px !important; }
.cmp-dd { border: 1px solid var(--cmp-line); border-radius: var(--radius-sm); padding: 6px; background: var(--card); }
.cmp-dd-svg { width: 100%; height: auto; display: block; }
.cmp-dd-grid { stroke: rgba(148, 163, 184, 0.18); stroke-width: 1; }
.cmp-dd-axis { fill: var(--text-muted); font-size: 11px; }
.cmp-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 14px; }
.cmp-threshold { display: flex; gap: 6px; align-items: center; }
.cmp-threshold input { width: 84px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--cmp-line); background: var(--card); color: inherit; }
.cmp-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(56, 189, 248, 0.14); color: #bae6fd; }
.cmp-inline-form { display: inline; }
