/* Investment Types: page-specific pieces on top of ai-analysis.css + top-models.css */
:root { --green: #26e6a4; --orange: #ffaa00; --red: #ff5c5c; }

/* Search in the top bar, same as AI Subscriptions */
.top-nav { gap: 20px; }
.q-wrap { position: relative; flex: 1; max-width: 560px; }
.q-wrap > .bi-search { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#q { width: 100%; padding: 6px 110px 6px 44px; line-height: 1.2; border-radius: 22px; border: 1px solid rgba(247, 147, 26, 0.45); background: rgba(247, 147, 26, 0.05); color: var(--text-main); font-family: inherit; font-size: 1rem; }
#q::placeholder { color: var(--text-muted); }
#q:focus { outline: none; border-color: var(--primary); background: rgba(247, 147, 26, 0.09); }
#q::-webkit-search-cancel-button { display: none; }
#qClear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent; color: var(--text-dim); cursor: pointer; }
#qClear:hover { color: var(--ink); background: rgba(var(--fg), 0.08); }
.q-info { position: absolute; right: 44px; top: 50%; transform: translateY(-50%); font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; pointer-events: none; }
.q-info strong { color: var(--text-main); font-weight: 600; }
@media (max-width: 768px) {
    .top-nav { gap: 10px; }
    .top-nav .logo-link span, .top-nav .nav-date { display: none; }
    #q { padding-right: 90px; font-size: 0.9rem; }
}

/* 16 links are too tall to stay sticky */
.it-nav { position: static; gap: 6px; padding: 10px 12px; }
.section { scroll-margin-top: 140px; }
.it-nav a { padding: 5px 11px; font-size: 0.68rem; letter-spacing: 0.6px; }

.it-legend { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--text-dim); margin: -12px 0 36px; }
.it-legend b { color: var(--text-main); font-weight: 600; }

.it-table td { text-align: left; vertical-align: top; }
.matrix-wrap { scrollbar-width: thin; scrollbar-color: rgba(var(--fg), 0.18) transparent; }
.matrix-wrap::-webkit-scrollbar { height: 8px; }
.matrix-wrap::-webkit-scrollbar-track { background: transparent; }
.matrix-wrap::-webkit-scrollbar-thumb { background: rgba(var(--fg), 0.18); border-radius: 4px; }
.it-table th { text-align: left; white-space: nowrap; padding: 8px 6px; }

/* Filterable headers */
.th-f { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--text-dim); background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 4px 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s ease; }
.th-f i { font-size: 0.68rem; opacity: 0.45; transition: opacity 0.2s ease; }
.th-f:hover { color: var(--ink); border-color: rgba(var(--fg), 0.14); background: rgba(var(--fg), 0.04); }
.th-f:hover i { opacity: 1; }
.th-f.open { color: var(--ink); border-color: rgba(var(--fg), 0.25); background: rgba(var(--fg), 0.06); }
.th-f.on { color: var(--accent); border-color: rgba(0, 204, 255, 0.45); background: rgba(0, 204, 255, 0.08); }
.th-f.on i { opacity: 1; }
.th-pop { position: absolute; z-index: 950; width: min(440px, calc(100vw - 24px)); display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(20, 23, 34, 0.98); backdrop-filter: blur(12px); border: 1px solid var(--card-border); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
.th-pop[hidden] { display: none; }
.th-pop-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--primary); }
.th-pop .fp-row { grid-template-columns: 1fr; gap: 6px; }
.th-pop .fp-l:empty { display: none; }
.th-pop .fp-row .f-chip { padding: 4px 10px; }
.th-pop .fp-row .f-chip .ret-pill { font-size: 0.7rem; padding: 0 6px; }
.th-pop .fp-row .f-chip .risk { padding-top: 0; }
.th-pop .fp-row .f-chip .risk i { width: 7px; height: 7px; }
.th-pop .fi { font-size: 0.78rem; }
.it-table td:first-child { min-width: 320px; max-width: 420px; }
.it-n { font-size: 0.95rem; font-weight: 700; color: var(--ink); line-height: 1.3; letter-spacing: 0.1px; }
.it-d { font-size: 0.78rem; color: #8d93a3; line-height: 1.45; margin-top: 4px; max-width: 340px; font-variant-numeric: normal; }
.it-table tbody tr:not(.it-group) td { transition: background 0.2s ease, box-shadow 0.2s ease; }
.it-table tbody tr:not(.it-group):hover td { background: rgba(var(--fg), 0.025); }
.it-table tbody tr:not(.it-group):hover td:first-child { background: #191c29; box-shadow: inset 3px 0 0 var(--primary); }
.it-table tbody tr:not(.it-group):hover .it-n { color: var(--primary); }
.it-ret { white-space: nowrap; font-weight: 600; }
.it-min { white-space: nowrap; color: var(--text-main); }
.it-group td { background: rgba(var(--fg), 0.03); font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--primary); padding: 8px 10px; }
.it-group td:first-child { background: #181b27; }
.it-group small { color: var(--text-muted); letter-spacing: 0; margin-left: 4px; }

.new-tag { font-size: 0.58rem; font-weight: 700; letter-spacing: 1.2px; color: #8eeaff; background: linear-gradient(90deg, rgba(0, 204, 255, 0.2), rgba(167, 139, 250, 0.2)); border: 1px solid rgba(0, 204, 255, 0.45); border-radius: 8px; padding: 1px 6px; vertical-align: 2px; margin-left: 6px; box-shadow: 0 0 10px rgba(0, 204, 255, 0.18); }

/* Location flags after the name */
.it-flags { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: 1px; cursor: help; }
.fi { width: 1.3em; line-height: 0.95em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(var(--fg), 0.12); }
.it-flags .fi { font-size: 0.82rem; }
.fl-ww { color: #4fd8c4; font-size: 0.85rem; }
.fl-rg { color: #c9b8ff; font-size: 0.85rem; }
.fl-xus { position: relative; display: inline-flex; }
.fl-xus .fi { filter: grayscale(0.85) brightness(0.75); }
.fl-xus::after { content: ''; position: absolute; left: -3px; right: -3px; top: calc(50% - 1.5px); height: 3px; background: #ff3b3b; transform: rotate(-32deg); border-radius: 2px; box-shadow: 0 0 0 1px rgba(var(--bg-rgb), 0.9); }
.it-legend .fi, .fp-row .fi { font-size: 0.78rem; }
.fp-row .f-chip .bi, .fp-row .f-chip .fl-xus, .fp-row .f-chip .fi { margin-right: 1px; }

.earn { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; white-space: nowrap; border: 1px solid; }
.earn i { font-size: 0.78rem; }

/* Return pill: colour steps with the middle of the range, speculative ranges get the red-to-green swing */
.ret-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; border: 1px solid; font-variant-numeric: tabular-nums; }
.ret-pill.t1 { color: #b7bcc6; background: rgba(138, 143, 152, 0.12); border-color: rgba(138, 143, 152, 0.35); }
.ret-pill.t2 { color: #7fb4f5; background: rgba(57, 135, 229, 0.12); border-color: rgba(57, 135, 229, 0.4); }
.ret-pill.t3 { color: #4fd8c4; background: rgba(25, 179, 160, 0.13); border-color: rgba(25, 179, 160, 0.42); }
.ret-pill.t4 { color: #26e6a4; background: rgba(38, 230, 164, 0.13); border-color: rgba(38, 230, 164, 0.45); }
.ret-pill.t5 { color: #c4ec6a; background: rgba(182, 227, 90, 0.14); border-color: rgba(182, 227, 90, 0.48); }
.ret-pill.t6 { color: #0f111a; background: linear-gradient(90deg, #f7c21a, #f7931a); border-color: transparent; }
.ret-pill.swing { color: var(--ink); background: linear-gradient(90deg, rgba(255, 92, 92, 0.28), rgba(38, 230, 164, 0.28)); border-color: rgba(var(--fg), 0.18); }
.ret-pill.swing i { color: #ffd34d; font-size: 0.72rem; }
.ret-pill.plain { color: var(--text-dim); font-weight: 600; background: transparent; border-style: dashed; border-color: rgba(var(--fg), 0.18); white-space: normal; }
.it-legend .ret-pill { font-size: 0.7rem; padding: 1px 7px; }
.ret-bar { display: block; position: relative; width: 110px; height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(var(--fg), 0.07); }
.ret-bar > span { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.ret-bar .t1 { background: #8a8f98; }
.ret-bar .t2 { background: #3987e5; }
.ret-bar .t3 { background: #19b3a0; }
.ret-bar .t4 { background: #26e6a4; }
.ret-bar .t5 { background: #b6e35a; }
.ret-bar .t6 { background: #f7c21a; }
.ret-bar.swing { background: linear-gradient(90deg, #ff5c5c, #e8c547 45%, #26e6a4); opacity: 0.75; }

/* Popularity: signal-strength bars */
.pop { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; vertical-align: -2px; }
.pop i { width: 4px; border-radius: 1px; background: rgba(var(--fg), 0.1); }
.pop i:nth-child(1) { height: 30%; }
.pop i:nth-child(2) { height: 45%; }
.pop i:nth-child(3) { height: 62%; }
.pop i:nth-child(4) { height: 80%; }
.pop i:nth-child(5) { height: 100%; }
.pop i.on { background: currentColor; }
.pop.p1, .pop-l.p1 { color: var(--text-muted); }
.pop.p2, .pop-l.p2 { color: #8fa3c0; }
.pop.p3, .pop-l.p3 { color: #7fb4f5; }
.pop.p4, .pop-l.p4 { color: var(--accent); }
.pop.p5, .pop-l.p5 { color: var(--primary); }
.pop-l { margin-left: 7px; font-size: 0.78rem; white-space: nowrap; }
.it-pop { white-space: nowrap; }

/* Your profit for the budget */
.it-pf { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-y { font-weight: 700; color: var(--ink); font-size: 0.88rem; }
.pf-m { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.it-pf small { font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.it-pf .neg { color: var(--red); }
.pf-to { font-weight: 400; color: var(--text-muted); font-size: 0.72rem; }
.pf-na { font-size: 0.78rem; color: var(--text-muted); }
.pf-need { font-size: 0.78rem; color: var(--orange); }
.pf-need i { font-size: 0.7rem; }
.budget { display: inline-flex; align-items: center; gap: 8px; margin-right: 10px; }
.budget-box { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; border: 1px solid var(--primary); background: rgba(247, 147, 26, 0.08); color: var(--primary); font-weight: 700; }
.budget-box input { width: 110px; background: transparent; border: none; outline: none; color: var(--ink); font-family: inherit; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Budget + new-era filter bar, sticky so the budget stays reachable while scrolling */
.it-filter { align-items: center; margin: -20px 0 32px; position: sticky; top: 72px; z-index: 900; padding: 10px 14px; border-radius: 30px; background: rgba(var(--bg-rgb), 0.88); backdrop-filter: blur(10px); border: 1px solid var(--card-border); }
/* Favorites */
.it-name { position: relative; padding: 12px 12px 12px 50px !important; }
.fav-btn { position: absolute; left: 12px; top: 11px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(var(--fg), 0.1); background: rgba(var(--fg), 0.03); cursor: pointer; color: var(--text-muted); font-size: 0.82rem; line-height: 1; transition: all 0.2s ease; }
.fav-btn:hover { color: #ffd34d; border-color: rgba(255, 211, 77, 0.5); transform: scale(1.08); }
.fav-btn[aria-pressed="true"] { color: #ffd34d; border-color: rgba(255, 211, 77, 0.55); background: rgba(255, 211, 77, 0.12); box-shadow: 0 0 12px rgba(255, 211, 77, 0.25); }
tr.is-fav td { background: rgba(255, 211, 77, 0.035); }
tr.is-fav td:first-child { background: #1a1b22; box-shadow: inset 3px 0 0 #ffd34d; }
.fav-ico { color: #ffd34d; }
.it-empty { text-align: center; color: var(--text-dim); padding: 50px 16px; }

/* Filters dropdown under the sticky bar */
.fp-toggle.open, .fp-toggle:has(.fp-count:not([hidden])) { color: var(--ink); border-color: var(--accent); background: rgba(0, 204, 255, 0.1); }
.fp-count { font-size: 0.7rem; min-width: 18px; padding: 1px 5px; border-radius: 9px; background: var(--accent); color: #0f111a; text-align: center; }
.fp-shown { font-size: 0.78rem; color: var(--text-dim); margin-left: auto; }
.fp-reset { font-family: inherit; font-size: 0.78rem; background: none; border: none; color: var(--text-dim); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.fp-reset:hover { color: var(--red); }
.fp-panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); display: grid; gap: 10px; padding: 16px 18px; border-radius: 18px; background: rgba(20, 23, 34, 0.97); backdrop-filter: blur(12px); border: 1px solid var(--card-border); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); max-height: calc(100vh - 200px); overflow-y: auto; }
.fp-panel[hidden] { display: none; }
.fp-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.fp-l { font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.fp-row .f-chip { padding: 4px 10px; }
.fp-row .f-chip .ret-pill { font-size: 0.7rem; padding: 0 6px; }
.fp-row .f-chip .risk { padding-top: 0; }
.fp-row .f-chip .risk i { width: 7px; height: 7px; }

@media (max-width: 768px) {
    .fp-row { grid-template-columns: 1fr; gap: 6px; }
    .fp-panel { padding: 12px; max-height: calc(100vh - 180px); }
    .fp-shown { margin-left: 0; }
    .it-filter { top: 62px; gap: 6px; padding: 8px 10px; border-radius: 18px; }
    .it-filter > .chip-sep { display: none; }
    .budget { margin-right: 0; flex-basis: 100%; }
    .budget-box input { width: 100%; }
    .budget-box { flex: 1; }
    .section { scroll-margin-top: 175px; }
}
.it-filter .chip-sep { margin-left: 0; }
.it-filter .f-chip small { color: var(--text-muted); }
.it-filter .new-tag { margin-left: 0; vertical-align: 0; }
.earn.yield { color: var(--green); border-color: rgba(38, 230, 164, 0.4); }
.earn.growth { color: #6fb0ff; border-color: rgba(57, 135, 229, 0.5); }
.earn.spread { color: #b9b1ff; border-color: rgba(144, 133, 233, 0.5); }
.earn.business { color: var(--primary); border-color: rgba(247, 147, 26, 0.45); }

.risk { display: inline-flex; gap: 3px; padding-top: 5px; }
.risk i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.risk i.off { background: rgba(var(--fg), 0.1); }
.risk.r1 { color: var(--green); }
.risk.r2 { color: #9bd96a; }
.risk.r3 { color: #e8c547; }
.risk.r4 { color: var(--orange); }
.risk.r5 { color: var(--red); }

.liq, .eff { white-space: nowrap; }
.liq.l1, .liq.l2 { color: var(--green); }
.liq.l5 { color: var(--text-dim); }
.eff.e0 { color: var(--green); }
.eff.e2 { color: var(--text-dim); }

@media (max-width: 768px) {
    .it-table td:first-child { min-width: 190px; }
    .it-nav a { padding: 4px 8px; font-size: 0.62rem; }
}

/* Click-to-open detail panel under a row */
.it-table tr.has-det { cursor: pointer; }
.it-table tr.has-det:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.it-chev { margin-left: 8px; font-size: 0.7rem; color: var(--text-muted); display: inline-block; transition: transform 0.2s ease, color 0.2s ease; }
.it-table tr.has-det:hover .it-chev { color: var(--primary); }
.it-table tr.is-open .it-chev { transform: rotate(180deg); color: var(--primary); }
.it-table tr.is-open td { background: rgba(var(--fg), 0.025); border-bottom-color: transparent; }
.it-table tr.is-open td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.it-table tbody tr.it-detail td { position: static; text-align: left; min-width: 0; max-width: none; padding: 0 0 4px; background: rgba(var(--fg), 0.025); box-shadow: inset 3px 0 0 var(--primary); border-bottom: 1px solid var(--card-border); }
.it-det { position: sticky; left: 0; max-width: min(1100px, calc(100vw - 48px)); padding: 4px 18px 18px 50px; font-variant-numeric: normal; }
.it-how { font-size: 0.86rem; line-height: 1.6; color: var(--text-main); margin: 0 0 14px; max-width: 820px; }
.it-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.it-box { padding: 12px 14px; border-radius: 12px; background: var(--card-bg); border: 1px solid var(--card-border); }
.it-box h4 { margin: 0 0 8px; font-size: 0.68rem; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.it-box.pros h4 i { color: var(--green); }
.it-box.cons h4 i { color: var(--orange); }
.it-box.learn h4 i { color: #6fb0ff; }
.it-box.where h4 i { color: var(--primary); }
.it-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.it-box li { font-size: 0.8rem; line-height: 1.45; color: var(--text-main); }
.it-box.pros li, .it-box.cons li { padding-left: 14px; position: relative; }
.it-box.pros li::before, .it-box.cons li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.it-box.cons li::before { background: var(--orange); }
.it-box a { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(var(--fg), 0.15); transition: color 0.2s ease, border-color 0.2s ease; }
.it-box a:hover { color: var(--primary); border-color: var(--primary); }
.it-box a i { font-size: 0.62rem; color: var(--text-muted); margin-left: 2px; }
.it-box li small { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

@media (max-width: 1100px) {
    .it-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .it-det { padding: 4px 14px 14px 16px; max-width: calc(100vw - 34px); }
    .it-cols { grid-template-columns: 1fr; }
}

/* Bright skin */
:root[data-theme="light"] .th-f.on { border-color: rgba(2, 119, 181, 0.45); background: rgba(2, 119, 181, 0.07); }
:root[data-theme="light"] .th-pop,
:root[data-theme="light"] .fp-panel { background: rgba(255, 255, 255, 0.98); box-shadow: 0 12px 32px rgba(20, 24, 40, 0.16); }
:root[data-theme="light"] .it-d { color: #5a6075; }
:root[data-theme="light"] .it-table tbody tr:not(.it-group):hover td:first-child { background: #f3f5fa; }
:root[data-theme="light"] .it-group td:first-child { background: #f5f6fa; }
:root[data-theme="light"] tr.is-fav td:first-child { background: #fffaeb; box-shadow: inset 3px 0 0 #e0a800; }
:root[data-theme="light"] .new-tag { color: #0369a1; border-color: rgba(2, 119, 181, 0.35); }
:root[data-theme="light"] .fl-ww { color: #0f8a78; }
:root[data-theme="light"] .fl-rg { color: #6d28d9; }
:root[data-theme="light"] .ret-pill.t1 { color: #5b616e; }
:root[data-theme="light"] .ret-pill.t2 { color: #1d4ed8; }
:root[data-theme="light"] .ret-pill.t3 { color: #0f766e; }
:root[data-theme="light"] .ret-pill.t4 { color: #047857; }
:root[data-theme="light"] .ret-pill.t5 { color: #4d7c0f; }
:root[data-theme="light"] .ret-pill.swing i,
:root[data-theme="light"] .fav-ico,
:root[data-theme="light"] .fav-btn:hover,
:root[data-theme="light"] .fav-btn[aria-pressed="true"] { color: #d49a00; }
:root[data-theme="light"] .pop.p2, :root[data-theme="light"] .pop-l.p2 { color: #5a6b86; }
:root[data-theme="light"] .pop.p3, :root[data-theme="light"] .pop-l.p3 { color: #1d4ed8; }
:root[data-theme="light"] .fp-toggle.open,
:root[data-theme="light"] .fp-toggle:has(.fp-count:not([hidden])) { background: rgba(2, 119, 181, 0.08); }
:root[data-theme="light"] .fp-count { color: #fff; }
:root[data-theme="light"] .earn.growth { color: #1d4ed8; }
:root[data-theme="light"] .earn.spread { color: #6d28d9; }
:root[data-theme="light"] .risk.r2 { color: #5d9c2c; }
:root[data-theme="light"] .risk.r3 { color: #c99a06; }
