/* TechCap Intelligence — public site. Tokens follow the brand note: Midnight, Teal, Amber, Purple; dark theme in neutral grey. */
:root {
  --bg: #F4F6F9; --panel: #FFFFFF; --fg: #101827; --muted: #5B6577; --line: #E3E8EF; --soft: #EEF2F6;
  --c1: #14B8A6; --c2: #3B82F6; --c3: #988AFB; --c4: #F4B860; --c5: #65D6C2; --c6: #94A3B8;
  --good: #0E9F6E; --bad: #D93636; --focus: #3B82F6;
  --font: "Urbanist", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 12px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1C1D21; --panel: #26282D; --fg: #F2F3F5; --muted: #A3A8B3; --line: #363940; --soft: #303238;
    --good: #34D399; --bad: #F87171; --focus: #65D6C2; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding-block: max(20px, env(safe-area-inset-top, 0px)) 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px 20px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.intro { min-width: 0; }
h1 { margin: 0 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
#lead { margin: 0; color: var(--muted); max-width: 70ch; font-size: 16px; }
#lead b { color: var(--fg); font-weight: 700; }
.updated { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.brand { display: grid; justify-items: end; gap: 14px; }
.logo { width: 300px; aspect-ratio: 304 / 76; position: relative; }
.logo span { position: absolute; inset: 0; }
.lockup { display: grid; justify-items: start; }
.slogan { margin: -18px 0 0 66px; font-size: 14px; font-weight: 500; color: var(--muted); text-align: left; letter-spacing: .01em; }
.logo .w { background: var(--fg); -webkit-mask: url(logo-word.png?v=4) no-repeat 0 0 / 100% 100%; mask: url(logo-word.png?v=4) no-repeat 0 0 / 100% 100%; }
.logo .m { background: url(logo-mark.png?v=4) no-repeat 0 0 / 100% 100%; }
@media (max-width: 640px) { .slogan { margin: -12px 0 0 44px; font-size: 13px; } .logo { width: 200px; } h1 { font-size: 26px; } }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
select, input[type=search] { font: inherit; font-size: 15px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 9rem; min-height: 38px; }
.btn { font: inherit; font-weight: 600; font-size: 14px; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; min-height: 38px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.tile, .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.tile { padding: 16px; display: grid; align-content: start; gap: 2px; }
.tile h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.tile .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile .chg { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.up { color: var(--good) !important; } .down { color: var(--bad) !important; }
.card { padding: 18px; }
.card-head { margin-bottom: 12px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.note { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.chart { position: relative; min-height: 280px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.map svg { display: block; width: 100%; height: auto; max-height: 560px; margin: 0 auto; }
.chart text { font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--sw); }
.map { position: relative; min-height: 300px; }
.map path { stroke: var(--panel); stroke-width: .8; }
.map path.in { cursor: pointer; }
.map path.in:hover, .map path.sel { stroke: var(--fg); stroke-width: 1.6; }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.ramp { width: 160px; height: 10px; border-radius: 5px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; background: var(--line); }
.rank { display: grid; gap: 10px; }
.rrow { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto auto; column-gap: 8px; row-gap: 5px; align-items: center; font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.rrow.click { cursor: pointer; } .rrow.click:hover { background: var(--soft); }
.rrow .n { color: var(--muted); font-size: 12px; }
.rrow .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rrow .s { color: var(--muted); font-size: 12px; min-width: 4.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.rrow .track { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.rrow .fill { height: 100%; border-radius: 3px; }
.signals { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.signals b { font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 10px; }
.filters .grow { flex: 1 1 14rem; } .filters .grow input { width: 100%; }
.tbox { overflow: auto; border-top: 1px solid var(--line); }
.tbox.tall { max-height: 36rem; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; padding: 0; position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
th button { all: unset; cursor: pointer; display: block; padding: 8px; font-weight: 600; color: var(--muted); }
th.num button, td.num { text-align: right; }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.dim { color: var(--muted); max-width: 22rem; }
@media (max-width: 700px) { .hide-sm { display: none; } }
.more { margin-top: 10px; }
.tip { position: fixed; pointer-events: none; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 39, .16); padding: 7px 10px; font-size: 12px; max-width: 320px; }
.tip div:first-child { font-weight: 700; margin-bottom: 2px; }
.foot { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.foot p { margin: 0; }
.skel { color: transparent !important; background: var(--soft); border-radius: 6px; }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .chart svg, .rank { animation: fade .3s ease-out; } @keyframes fade { from { opacity: 0; } to { opacity: 1; } } }
dialog.join { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--fg); padding: 28px 24px 20px;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 24px 64px rgba(16, 24, 39, .28); }
dialog.join::backdrop { background: rgba(16, 24, 39, .55); }
dialog.join h2 { margin: 0; font-size: 20px; font-weight: 700; padding-right: 32px; }
dialog.join p { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
dialog.join .close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
dialog.join .close:hover { background: var(--soft); color: var(--fg); }
.join-form { min-height: 200px; min-width: 0; }
.join-form iframe { max-width: 100%; }
.tiles.mini { margin-bottom: 12px; }
.tiles.mini .tile { padding: 12px 14px; }
.tiles.mini .big { font-size: 22px; }
td.focus { color: var(--muted); max-width: 16rem; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--fg); white-space: nowrap; }
.pill.hot { background: color-mix(in srgb, var(--c1) 22%, transparent); }

/* startup search */
.co-search { position: relative; flex: 1 1 280px; max-width: 420px; margin-left: auto; }
.co-search input { width: 100%; font: inherit; font-size: 15px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px 0 38px; min-height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A94A6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }
#coResults { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 39, .16); }
#coResults li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
#coResults li span { color: var(--muted); font-size: 12px; }
#coResults li:hover, #coResults li.on { background: var(--soft); }
#coResults li.none { cursor: default; color: var(--muted); }
@media (max-width: 640px) { .co-search { order: 3; max-width: none; flex-basis: 100%; } }
.linkish { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: currentColor; }
.linkish:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.thl { display: block; padding: 8px; font-weight: 600; color: var(--muted); }
/* profile */
dialog.profile { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--fg); padding: 26px 24px 20px; width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 24px 64px rgba(16, 24, 39, .28); }
dialog.profile::backdrop { background: rgba(16, 24, 39, .55); }
dialog.profile .close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
dialog.profile .close:hover { background: var(--soft); color: var(--fg); }
.p-head h2 { margin: 0; font-size: 24px; font-weight: 700; padding-right: 36px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill.uni { background: color-mix(in srgb, var(--c3) 26%, transparent); }
.pill.exit { background: color-mix(in srgb, var(--c4) 30%, transparent); }
.p-meta { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.p-desc { margin: 12px 0 0; font-size: 15px; max-width: 70ch; }
.p-links { display: flex; gap: 14px; margin: 8px 0 0; font-size: 14px; font-weight: 600; }
dialog.profile .tiles.mini { margin: 16px 0 4px; }
.p-sec { margin: 18px 0 6px; font-size: 15px; font-weight: 700; }
.inv-list { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.inv-list li { font-size: 13px; background: var(--soft); border-radius: 999px; padding: 3px 10px; }
.inv-list li span { color: var(--muted); }
.p-src { margin-top: 16px; }
/* exits */
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); margin-bottom: 14px; }
h3.sub { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* custom period */
.range { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
input[type=month] { font: inherit; font-size: 15px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; min-height: 38px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.sm { min-height: 32px; font-size: 13px; padding: 0 10px; }
.card-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) { .bar { position: static; } }

/* compare countries */
.cmp-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; color: var(--fg); background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px 4px 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 32px; }
.chip .x { color: var(--muted); font-size: 16px; line-height: 1; }
.chip:hover .x { color: var(--fg); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.chip .dot { margin-right: 0; }
.tbox.cmp { margin-bottom: 6px; }
.tbox.cmp td:first-child { color: var(--muted); }
.tbox.cmp td.best { font-weight: 700; }
.tbox.cmp th.num .thl { text-align: right; }
.mix-h { margin-top: 18px; }
.mix { display: grid; gap: 8px; margin-bottom: 6px; }
.mix-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14px; }
.mix-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix-bar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--soft); }
.mix-bar span { height: 100%; }

.btn-accent { border-color: var(--c1); color: var(--fg); background: color-mix(in srgb, var(--c1) 14%, transparent); }
.btn-accent:hover { background: color-mix(in srgb, var(--c1) 24%, transparent); }

/* analysis */
.analysis .an-body { display: grid; gap: 8px; font-size: 15px; line-height: 1.6; max-width: 92ch; }
.analysis .an-body p { margin: 0; }
.analysis .an-body b, .takeaway b, .audience b { font-weight: 700; }
.audience { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 12px 28px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.audience ul { font-size: 14px; }
.warn { color: var(--bad); font-weight: 600; }
.muted { color: var(--muted); }
.takeaway { margin: 12px 0 0; font-size: 13.5px; line-height: 1.55; padding: 8px 12px; border-left: 3px solid var(--c1); background: color-mix(in srgb, var(--c1) 8%, transparent); border-radius: 0 8px 8px 0; }
.takeaway .tk-l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
#cmpOut > .takeaway { margin: 0 0 14px; }

/* palette: dark purple table headers, magenta bold labels */
:root { --head: #431550; --head-fg: #FFFFFF; --label: #FD0A71; }
th { background: var(--head); border-bottom-color: var(--head); }
th button, .thl { color: var(--head-fg); font-weight: 700; }
th button:hover { text-decoration: underline; text-underline-offset: 3px; }
th button:focus-visible { outline-color: var(--head-fg); outline-offset: -3px; }
th .dot { box-shadow: 0 0 0 1.5px var(--head-fg); }
thead tr th:first-child { border-top-left-radius: 6px; } thead tr th:last-child { border-top-right-radius: 6px; }
.tbox { border-top: 0; }
#lead b, .analysis .an-body b, .audience b, .takeaway b, .signals b { color: var(--label); }
.takeaway .tk-l { color: var(--label); }

/* market outlook */
.ol-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.btn.xs { min-height: 28px; font-size: 12px; padding: 0 9px; font-weight: 600; }
.ch-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.ch-head h3.sub { margin: 0; }
.verdict { display: grid; gap: 6px; padding: 14px 16px; border-radius: 10px; background: color-mix(in srgb, var(--head) 7%, transparent); border: 1px solid color-mix(in srgb, var(--head) 22%, transparent); margin-bottom: 14px; }
.verdict .stance { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.verdict .stance .pill { font-size: 12px; }
.verdict p { margin: 0; font-size: 15px; line-height: 1.6; max-width: 100ch; }
.verdict b, .outlook .signals b, .outlook .takeaway b, .sig .why b { color: var(--label); font-weight: 700; }
.lvl { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; letter-spacing: .02em; }
.lvl.pos { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.lvl.neg { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.lvl.mid { background: var(--soft); color: var(--muted); }
.lvl.big { font-size: 13px; padding: 3px 12px; }
.tiles.sig { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin-bottom: 16px; }
.sig .tile { padding: 12px 14px; gap: 4px; }
.sig .tile h3 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sig .val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sig .why { font-size: 12px; color: var(--muted); line-height: 1.45; }
.ol-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 14px 28px; padding: 14px 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ol-guide ul { font-size: 14px; }
.ol-charts { margin-bottom: 18px; }
.ol-chart { min-width: 0; }
.chart.short { min-height: 150px; }
.ol-tab-h { margin-top: 4px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px; margin: 1px 3px 1px 0; background: color-mix(in srgb, var(--c3) 22%, transparent); white-space: nowrap; }
.tag.hub { background: color-mix(in srgb, var(--head) 20%, transparent); }
.tag.rise { background: color-mix(in srgb, var(--good) 20%, transparent); }
.tag.pipe { background: color-mix(in srgb, var(--c5) 30%, transparent); }
.tag.cheap { background: color-mix(in srgb, var(--c4) 32%, transparent); }
td.pos { color: var(--good); } td.neg { color: var(--bad); }
.ol-disc { margin-top: 10px; }

.join-alt { margin: 10px 0 0; }
#joinForm { min-height: 380px; }
.legend span.dash::before { height: 0; width: 16px; border-top: 2px dashed var(--sw); border-radius: 0; background: none; vertical-align: 3px; }
