/* ════════════════════════════════════════════════════════════
   Fund Overlap — "Where Portfolios Collide"
   Deep violet-black · cyan + magenta translucent fields.
   Identity: a fund-picker rail, a pair-overlap reading, a
   common-holdings table, an overlapping-discs motif.
   ════════════════════════════════════════════════════════════ */

body[data-tool="overlap"] {
  --surface:        #0E0A16;
  --surface-raised: #171022;
  --surface-high:   #241834;
  --hairline:       rgba(150, 130, 210, 0.16);
  --hairline-bold:  rgba(150, 130, 210, 0.32);
  --accent:         #6FCBD4;
  --accent-bright:  #93E0E8;
  --accent-deep:    #13303A;
  --accent-glow:    rgba(111, 203, 212, 0.42);
  --contrast:       #D984BE;
  --contrast-bright:#EAA3D3;
  --contrast-soft:  rgba(217, 132, 190, 0.13);
  --contrast-glow:  rgba(217, 132, 190, 0.50);
}

/* picker | result */
.oa-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}
@media (max-width: 940px) { .oa-grid { grid-template-columns: 1fr; gap: 18px; } }

/* ── picker ──────────────────────────────────────────────── */
.oa-picker { display: flex; flex-direction: column; padding: clamp(22px, 2.4vw, 30px); }
body[data-tool="overlap"] .oa-search {
  width: 100%;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline-bold);
  border-radius: var(--r-ctl);
  padding: 11px 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
}
body[data-tool="overlap"] .oa-search::placeholder { color: var(--text-mute); }
body[data-tool="overlap"] .oa-search:focus {
  outline: none;
  border-color: var(--accent);
}
.oa-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 0 -6px 16px;
  padding: 0 6px;
}
.oa-cat {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-bright);
  margin: 16px 0 8px;
}
.oa-cat:first-child { margin-top: 4px; }
.oa-fund {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 130ms ease;
}
.oa-fund:hover { background: var(--surface-high); }
.oa-fund.is-disabled { opacity: 0.34; cursor: not-allowed; }
body[data-tool="overlap"] .oa-fund input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 17px; height: 17px;
  border: 1px solid var(--hairline-bold);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
body[data-tool="overlap"] .oa-fund input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
body[data-tool="overlap"] .oa-fund input:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid var(--surface);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.oa-fund-name { font-family: var(--sans); font-size: 13px; color: var(--text); line-height: 1.3; }
.oa-fund-amc { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-mute); margin-top: 2px; }
.oa-picker-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.oa-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.oa-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--surface);
  background: var(--accent);
  border-radius: 999px;
  padding: 5px 6px 5px 11px;
}
.oa-chip button {
  width: 16px; height: 16px;
  border: none;
  border-radius: 50%;
  background: rgba(14,10,22,0.25);
  color: var(--surface);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.oa-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.oa-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-mute);
}
.oa-count.is-full { color: var(--contrast-bright); }
body[data-tool="overlap"] .oa-run {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--surface);
  background: var(--accent-bright);
  border: none;
  border-radius: var(--r-ctl);
  padding: 12px 22px;
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease;
}
body[data-tool="overlap"] .oa-run:hover { background: var(--accent); }
body[data-tool="overlap"] .oa-run:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── result ──────────────────────────────────────────────── */
.oa-result { padding: clamp(24px, 3vw, 40px); min-height: 420px; }
.oa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 380px;
  gap: 12px;
}
.oa-empty .tk-kicker { color: var(--contrast-bright); }
.oa-empty h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  color: var(--text);
  margin: 0;
  font-variation-settings: "SOFT" 40, "opsz" 90;
}
.oa-empty p { font-family: var(--sans); font-size: 14px; color: var(--text-soft); max-width: 38ch; margin: 0; }
.oa-headline { margin-bottom: clamp(22px, 3vw, 36px); }
.oa-headline .tk-kicker { display: block; margin-bottom: 10px; }
.oa-figure {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(54px, 8vw, 104px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--contrast-bright);
  text-shadow: 0 0 60px var(--contrast-glow);
  font-feature-settings: "tnum";
}
.oa-headline-note {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-soft);
}
.oa-headline-note b { color: var(--text); font-weight: 600; }
.oa-sect-k {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-bright);
  margin: 0 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.oa-pair {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.oa-pair-names { font-family: var(--sans); font-size: 13px; color: var(--text); }
.oa-pair-pct {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  font-feature-settings: "tnum";
}
.oa-pair-track {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-high);
  overflow: hidden;
}
.oa-pair-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent), var(--contrast));
}
.oa-hold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--sans);
  font-size: 13px;
}
.oa-hold-name { color: var(--text); }
.oa-hold-meta { font-family: var(--mono); font-size: 12px; color: var(--text-mute); flex: none; }
.oa-hold-meta b { color: var(--contrast-bright); font-weight: 600; }

/* Mobile · iOS auto-zoom guard on the fund-picker search input.
   body[data-tool="overlap"] .oa-search above has specificity 0,2,1
   so the generic .oa-search 16px override in tools.css loses to it.
   Match the specificity (and source-order-after) here. */
@media (max-width: 720px) {
  body[data-tool="overlap"] .oa-search { font-size: 16px; }
}
