@font-face { font-family: Archivo; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap; src: url(fonts/archivo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Archivo; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap; src: url(fonts/archivo-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #FFFFFF;
  --tint: #F1F4F6;
  --sea: #E3E9ED;
  --land: #F9FBFB;
  --coast: #BECAD1;
  --ink: #16202A;
  --muted: #55636E;
  --line: #DCE3E7;
  --accent: #C64A06;
  --focus: #1F5FD1;
  --tools: 110px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scrollbar-color: #B5C1C9 transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Archivo, system-ui, sans-serif; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }
mark { background: #FFE3B8; color: inherit; border-radius: 2px; }
a { color: inherit; text-decoration-color: #9AA9B3; text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

.top { display: flex; align-items: center; gap: 20px; padding: 14px 24px 10px; }
h1 { font-size: 1.35rem; font-weight: 800; font-stretch: 118%; letter-spacing: -0.01em; white-space: nowrap; }
.byline { flex: 1; color: var(--muted); font-size: 0.9rem; }
.add { padding: 7px 14px; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.add:hover { background: var(--accent); color: #fff; }

.tools { position: sticky; top: 0; z-index: 5; display: grid; gap: 10px; padding: 4px 24px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.search { display: flex; gap: 8px; }
#q { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid #B5C1C9; border-radius: 8px; background: var(--bg); font-size: 1.05rem; caret-color: var(--accent); }
#q::placeholder { color: #6A7883; }
.phone { display: none; }
.filters, .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
select, .chip, .pill, #view { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 0.92rem; }
.filters select { max-width: 132px; padding: 0 4px 0 10px; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 17px; flex: none; }
#layer .chip { padding: 0 11px; }
#layer { gap: 6px; }
#layer .chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chip[aria-pressed="true"]::before { background: #fff !important; }
.chip:hover, select:hover, #view:hover { background: var(--tint); }
.chip[aria-pressed="true"]:hover { background: var(--c); }
.pill { background: var(--ink); border-color: var(--ink); color: #fff; }
.plain { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
.plain:hover { color: var(--accent); }

body.wide-map main { grid-template-columns: minmax(0, 1fr) 66%; }
main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 52%); }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px; color: var(--muted); font-size: 0.92rem; }
#clear { margin-left: 10px; }
#count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar select { height: 30px; padding: 0 6px; margin-left: 6px; }

.row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 124px 92px 58px;
  gap: 0 16px;
  align-items: center;
  min-height: 62px;
  padding: 9px 24px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 62px;
  scroll-margin: calc(var(--tools) + 8px) 0 8px;
}
.row:hover { background: var(--tint); }
.row.on { background: #F4F7F9; }
.logo { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; object-fit: contain; font-weight: 800; color: var(--c); }
.name { padding: 0; border: 0; background: none; font-weight: 700; font-size: 1.02rem; text-align: left; }
.name:hover { color: var(--accent); }
.what { color: var(--muted); font-size: 0.93rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.where button { padding: 0; border: 0; background: none; text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.where button:hover { color: var(--accent); text-decoration: underline; }
.kind { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.88rem; line-height: 1.2; }
.kind::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c); }
.team { color: var(--muted); font-size: 0.88rem; }
.raised { display: grid; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.raised span { color: var(--muted); }
.links { display: grid; grid-template-columns: repeat(2, 26px); gap: 3px 4px; justify-content: center; }
.links .ico:last-child { grid-column: 1 / -1; justify-self: center; }
.ico { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #B5C1C9; border-radius: 50%; color: var(--ink); background: var(--bg); }
a.ico:hover { border-color: var(--accent); color: var(--accent); }
.ico.off { border-style: dashed; border-color: var(--line); color: #C3CDD3; }
.group { position: sticky; top: var(--tools); z-index: 1; padding: 6px 24px; background: var(--tint); font-weight: 700; border-top: 1px solid var(--line); }
.foot { display: flex; gap: 20px; padding: 18px 24px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.foot a:hover, .legal:hover { color: var(--accent); }
.legal { position: absolute; left: 10px; bottom: 8px; z-index: 2; padding: 2px 6px; border-radius: 4px; background: rgb(255 255 255 / 0.8); color: var(--muted); font-size: 0.78rem; }
.empty { padding: 32px 24px; display: grid; gap: 14px; color: var(--muted); }

.side { position: sticky; top: var(--tools); height: calc(100dvh - var(--tools)); display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.mapbox { position: relative; overflow: hidden; flex: 1 1 100%; min-height: 220px; background: var(--sea); }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
.land { fill: var(--land); stroke: var(--coast); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.city { cursor: pointer; }
.bubble { fill-opacity: 0.85; stroke: #fff; stroke-width: 1; }
.city.off .bubble { fill-opacity: 0.3; }
.city.hover .bubble, .city.on .bubble { fill: #E8590C !important; fill-opacity: 1; }
.city text { text-anchor: middle; pointer-events: none; font-weight: 600; }
.city .n { fill: #fff; font-size: 11px; dominant-baseline: central; font-weight: 700; }
.city .label { display: none; font-size: 12px; fill: var(--ink); paint-order: stroke; stroke: var(--land); stroke-width: 3px; stroke-linejoin: round; }
.city.labelled .label, .city.hover .label, .city.on .label { display: block; }
.city.open > .bubble, .city.open > .n, .city:not(.open) > .logos { display: none; }
.chiplogo circle { fill: #fff; stroke-width: 2; }
.chiplogo text { font-size: 13px; font-weight: 800; fill: var(--ink); dominant-baseline: central; }
.chiplogo.dark circle { fill: var(--ink); }
.logo.dark { background: var(--ink); }
.chiplogo image { pointer-events: none; }
.chiplogo.over circle, .chiplogo.picked circle { stroke: var(--ink) !important; stroke-width: 3; }
.city .logos { transition: opacity 200ms; }
.city.off .logos { opacity: 0.35; }
@media (prefers-reduced-motion: no-preference) {
  .city.open > .logos { animation: pop 180ms cubic-bezier(0.2, 0.9, 0.3, 1); }
  @keyframes pop { from { opacity: 0; transform: scale(0.55); } }
}
.tip { position: absolute; left: 0; top: 0; z-index: 2; width: max-content; max-width: 260px; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 0.9rem; pointer-events: none; }
.tip b, .tip span { display: block; }
.tip span { color: #C9D3DA; }
.zoom { position: absolute; right: 12px; top: 12px; display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.zoom button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-bottom: 1px solid var(--line); background: #fff; font-size: 1.2rem; }
.zoom button:last-child { border-bottom: 0; }
.zoom button:hover { background: var(--tint); }

.row.on .what { -webkit-line-clamp: unset; }
.expanded { background: #F4F7F9; border-top: 1px solid var(--line); }
.expanded .detail { max-width: 640px; padding: 4px 24px 22px 76px; }
.detail { padding: 18px 20px 28px; display: grid; gap: 14px; }
.detail header { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; }
.detail h2 { font-size: 1.4rem; line-height: 1.15; font-weight: 800; }
.detail h3 { font-size: 0.95rem; margin-top: 4px; }
.close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--tint); font-size: 1.4rem; line-height: 1; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; }
.cta a { padding: 7px 14px; border: 1px solid #B5C1C9; border-radius: 6px; font-weight: 600; text-decoration: none; }
.cta a:hover { border-color: var(--accent); }
.cta a:first-child { background: var(--ink); border-color: var(--ink); color: #fff; }
.cta a:first-child:hover { background: var(--accent); border-color: var(--accent); }
.soft { color: var(--muted); }
dl { display: grid; grid-template-columns: 92px 1fr; gap: 5px 12px; }
dt { color: var(--muted); }
dd::first-letter { text-transform: uppercase; }
.founders li { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 3px 0; }
.founders span { font-weight: 600; }
.similar li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 4px 0; }
.similar .logo { width: 26px; height: 26px; border-radius: 6px; font-size: 0.8rem; }
.similar .name { font-size: 0.95rem; }
.similar span:last-child { color: var(--muted); }
.detail footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }

#sheet { width: 100%; max-width: none; max-height: 86dvh; margin: auto 0 0; padding: 0 0 env(safe-area-inset-bottom); border: 0; border-radius: 16px 16px 0 0; overflow-y: auto; overscroll-behavior: contain; color: var(--ink); }
#sheet::backdrop { background: rgb(22 32 42 / 0.45); }
@media (prefers-reduced-motion: no-preference) {
  #sheet[open] { animation: rise 220ms cubic-bezier(0.2, 0.9, 0.3, 1); }
  @keyframes rise { from { transform: translateY(40%); } }
}

@media (max-width: 1240px) {
  .row { grid-template-columns: 36px minmax(0, 1fr) 112px 58px; }
  .raised { display: none; }
}

@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 2px 12px; padding: 10px 16px 6px; }
  h1 { flex: 1; font-size: 1.12rem; }
  .add { padding: 6px 10px; font-size: 0.9rem; }
  .byline { font-size: 0.82rem; }
  .byline { order: 3; flex-basis: 100%; }
  .tools { padding: 4px 16px 10px; gap: 8px; }
  .phone { display: block; }
  #q, select { font-size: 16px; }
  #q { font-size: 16px; }
  #view { height: 44px; font-weight: 600; background: var(--ink); border-color: var(--ink); color: #fff; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  #layer { flex-wrap: nowrap; }
  .filters > * { flex: none; }
  .chip, .filters select { height: 40px; }
  main { display: block; }
  .side { display: none; position: static; height: calc(100dvh - var(--tools)); border: 0; }
  .show-map .side { display: flex; }
  .show-map .results { display: none; }
  .bar { padding: 8px 16px; }
  .row { grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 2px 12px; padding: 12px 16px; }
  .logo { grid-row: span 1; }
  .where, .links { grid-column: 2; }
  .links { display: flex; gap: 10px; justify-content: start; margin-top: 4px; }
  .ico { width: 34px; height: 34px; }
  .where { display: flex; gap: 14px; align-items: baseline; }
  .group { padding-inline: 16px; }
  .zoom button { width: 44px; height: 44px; }
  #wide { display: none; }
  .close { width: 44px; height: 44px; }
  .founders li, .similar li { padding: 8px 0; }
  .expanded .detail { padding: 4px 16px 20px; }
}

body.wide-map .row { grid-template-columns: 36px minmax(0, 1fr); }
body.wide-map :is(.where, .raised, .links) { display: none; }
