:root {
  --ah-bg: var(--aa-ground);
  --ah-surface: var(--aa-surface);
  --ah-text: var(--aa-ink);
  --ah-muted: var(--aa-muted);
  --ah-accent: var(--aa-info);
  --ah-line: var(--aa-rule);
  --ah-green: var(--aa-ok);
  --ah-yellow: #b45309;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--ah-bg); color: var(--ah-text); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; }

.ah-container a:not(.ah-tab) { color: var(--ah-accent); text-decoration: none; }
.ah-container a:not(.ah-tab):hover { text-decoration: underline; }
.ah-container a:not(.ah-tab):visited { color: var(--ah-accent); }

button, input, select, textarea { font-family: inherit; }
.ah-controls input[type="text"],
.ah-controls input[type="number"],
.ah-controls input[type="search"],
.ah-controls input[type="url"],
.ah-controls select,
.ah-controls textarea,
.ah-content input[type="text"],
.ah-content input[type="number"],
.ah-content input[type="search"],
.ah-content input[type="url"],
.ah-content select,
.ah-content textarea {
  background: var(--ah-surface);
  color: var(--ah-text);
  border: 1px solid var(--ah-line);
  border-radius: 6px;
  padding: 6px 8px;
}
.ah-controls input::placeholder,
.ah-content input::placeholder,
.ah-content textarea::placeholder { color: var(--ah-muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ah-accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ah-accent); box-shadow: 0 0 0 2px rgba(29,79,161,.20); }

.ah-container { max-width: 1200px; margin: 0 auto; padding: 16px; }

.ah-header { background: var(--ah-surface); border-bottom: 1px solid var(--ah-line); }
.ah-title { margin: 0; font-size: 24px; font-weight: 700; }
.ah-subtitle { margin: 6px 0 0; color: var(--ah-muted); font-size: 14px; }
.ah-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.ah-controls { display: grid; grid-template-columns: 1fr; row-gap: 12px; margin: 16px 0 12px; }
.ah-tabs { display: inline-flex; gap:11px; }
.ah-tab { background: transparent; color: var(--ah-text); border: 1px solid var(--ah-line); padding:11px 12px; border-radius:11px; cursor: pointer; }
.ah-tab--active { background: var(--ah-accent); border-color: var(--ah-accent); }
.ah-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: end; color: var(--ah-muted); }
.ah-filters__group { display: grid; grid-auto-rows: minmax(0, auto); grid-row-gap:11px; }
.ah-filters label { display: flex; flex-direction: column; gap: 6px; }
.ah-filters input[type="text"], .ah-filters select { background: var(--ah-surface); color: var(--ah-text); border: 1px solid var(--ah-line); padding: 6px 8px; border-radius: 6px; }
.ah-filters__meta { display: flex; gap: 12px; justify-content: flex-end; align-items: end; }
.ah-counts { color: var(--ah-muted); font-size: 12px; padding-left:11px; border-left: 1px solid var(--ah-line); white-space: nowrap; }

.ah-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 900px) { .ah-grid { grid-template-columns: 1fr; } }

.ah-list { background: var(--ah-surface); border: 1px solid var(--ah-line); border-radius:11px; padding:11px; height: calc(100vh - 180px); height: calc(100dvh - 180px); overflow-y: scroll; overflow-x: hidden; scrollbar-gutter: stable both-edges; scrollbar-width: auto; }
.ah-list::-webkit-scrollbar { width:11px; height:11px; }
.ah-list::-webkit-scrollbar-track { background: rgba(30,27,22,.10); border-radius:11px; }
.ah-list::-webkit-scrollbar-thumb { background: rgba(29,79,161,.20); border-radius:11px; }
.ah-list__ul { list-style: none; padding: 0; margin: 0; }
.ah-list__item { padding:11px; border-radius:11px; border: 1px solid transparent; cursor: pointer; }
.ah-list__item:hover { background: rgba(30,27,22,.04); }
.ah-list__item.active { border-color: var(--ah-accent); background: rgba(29,79,161,.20); }
.ah-list__name { font-weight: 600; }
/* Make name row carry multiplier aligned to the right */
.ah-list__name { display: flex; align-items: center; justify-content: space-between; gap:11px; }
.ah-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-inline-search { position: sticky; top: 0; z-index: 3; background: var(--ah-surface); border-bottom: 1px solid var(--ah-line); padding: 6px 6px 8px; margin: -8px -8px 8px; } /* stretch to container edges */
.ah-inline-search input { width: 100%; }
.ah-multiple { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ah-multiple__icon { font-size: 12px; opacity: 0.9; }
.ah-multiple__value { font-size: 13px; }
.ah-multiple--surge .ah-multiple__value,
.ah-multiple--up .ah-multiple__value { color: var(--aa-ok); } /* green */
.ah-multiple--down .ah-multiple__value { color: var(--aa-bad); } /* red */
.ah-multiple--flat .ah-multiple__value { color: var(--ah-muted); } /* grey */
.ah-multiple--stale .ah-multiple__value { color: var(--ah-yellow); } /* warning */
.ah-multiple--dead .ah-multiple__value { color: var(--aa-bad); } /* red for dead */
.ah-multiple--unknown .ah-multiple__value { color: var(--aa-muted); } /* slate-ish */
.ah-list__company { color: var(--ah-muted); font-size: 12px; } /* kept for backwards compat if used elsewhere */
.ah-list__event { color: var(--ah-muted); font-size: 12px; }
.ah-list__meta { color: var(--ah-muted); font-size: 12px; margin-top: 2px; }
.ah-list__companies { display: flex; flex-wrap: wrap; gap: 6px; margin-top:11px; }
.ah-chip { 
  background: rgba(30,27,22,.04);
  color: var(--ah-text);
  border: 1px solid var(--ah-line);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.ah-chip:hover { background: rgba(30,27,22,.10); border-color: rgba(30,27,22,.16); }
.ah-chip:active { transform: translateY(1px); }
.ah-chip.active { background: rgba(29,79,161,.20); border-color: var(--ah-accent); box-shadow: inset 0 0 0 1px rgba(29,79,161,.20); }

.ah-content { min-height: 400px; }
.ah-content { padding-bottom: 20vh; }
.ah-company-select { margin-bottom: 12px; }
.ah-company-select__wrap { display: flex; gap:11px; align-items: center; }
.ah-company-select__label { color: var(--ah-muted); }
.ah-company-select__select { background: var(--ah-surface); color: var(--ah-text); border: 1px solid var(--ah-line); padding: 6px 8px; border-radius: 6px; }

.ah-note { background: rgba(30,27,22,.04); border: 1px dashed var(--ah-line); border-radius:11px; padding:11px 12px; margin:11px 0 16px; color: var(--ah-muted); font-size: 12px; }
.ah-note a { color: var(--ah-accent); text-decoration: none; }
.ah-note a:hover { text-decoration: underline; }

.ah-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 20px; }
@media (max-width: 900px) { .ah-metrics { grid-template-columns: 1fr; } }
.ah-metric-card { background: var(--ah-surface); border: 1px solid var(--ah-line); border-radius:11px; padding: 12px; }
.ah-metric-title { color: var(--ah-muted); font-size: 12px; }
.ah-metric-value { font-size: 20px; font-weight: 700; margin: 6px 0 8px; }
.ah-metric-hints { display: flex; flex-direction: column; gap: 4px; color: var(--ah-muted); font-size: 12px; }
.ah-badge { display: inline-block; font-size:11px; padding: 2px 6px; border-radius: 999px; margin-left: 6px; border: 1px solid var(--ah-line); }
.ah-badge.estimated { background: rgba(180,83,9,.15); color: #b45309; border-color: rgba(180,83,9,.15); }
.ah-badge.verified { background: rgba(26,122,67,.14); color: var(--aa-ok); border-color: rgba(26,122,67,.14); }
.ah-badge.unknown { background: rgba(30,27,22,.14); color: var(--aa-muted); border-color: rgba(30,27,22,.14); }

.ah-timeline { background: var(--ah-surface); border: 1px solid var(--ah-line); border-radius:11px; padding: 12px; }
.ah-section-title { margin: 0 0 8px; font-size: 16px; }
.ah-timeline__grid { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; padding:11px 0; border-bottom: 1px dashed var(--ah-line); }
.ah-grid-cell { height: 26px; border: 1px dashed var(--ah-line); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--ah-muted); font-size: 11px; }
.ah-timeline__events { position: relative; height: 60px; margin-top: 12px; }
.ah-marker { position: absolute; }
.ah-marker span { display: none; }
.ah-marker:before { content: ""; position: absolute; left: 0; top: 0; width:11px; height:11px; border-radius: 50%; border: 2px solid var(--ah-line); }
.ah-marker.founding:before { background: var(--ah-green); }
.ah-marker.agi:before { background: var(--ah-accent); }
.ah-marker.round:before { background: var(--ah-yellow); }

.ah-timeline__legend { display: flex; gap: 12px; align-items: center; color: var(--ah-muted); font-size: 12px; margin-top:11px; }
.legend-dot { display: inline-block; width:11px; height:11px; border-radius: 50%; margin: 0 5px 0 12px; border: 1px solid var(--ah-line); }
.legend-dot.founding { background: var(--ah-green); }
.legend-dot.agi { background: var(--ah-accent); }
.legend-dot.round { background: var(--ah-yellow); }

.ah-timeline__footnote { margin-top: 6px; color: var(--ah-muted); font-size: 11px; }

.ah-sources { margin-top: 16px; background: var(--ah-surface); border: 1px solid var(--ah-line); border-radius:11px; padding: 12px; }
.ah-sources__ul { margin:11px 0 0; padding-left: 16px; }
.ah-source-field { color: var(--ah-muted); font-size: 11px; margin-left: 6px; }

.ah-empty { color: var(--ah-muted); font-style: italic; }

.ah-rawjson { background: var(--ah-surface); border: 1px solid var(--ah-line); border-radius:11px; padding:11px 10px; margin-top: 12px; }
.ah-rawjson__header { display: flex; align-items: center; justify-content: space-between; gap:11px; margin-bottom: 6px; }
.ah-rawjson__pre { 
  white-space: pre-wrap;
  max-height: 80vh;
  overflow: auto;
  border: 1px dashed var(--ah-line);
  border-radius:11px;
  padding:11px;
  background: rgba(30,27,22,.04);
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(29,79,161,.20) rgba(30,27,22,.10);
}
.ah-rawjson__pre::-webkit-scrollbar { width:11px; height:11px; }
.ah-rawjson__pre::-webkit-scrollbar-track { background: rgba(30,27,22,.10); border-radius:11px; }
.ah-rawjson__pre::-webkit-scrollbar-thumb { background: rgba(29,79,161,.20); border-radius:11px; }
.ah-copy-btn {
  background: var(--ah-accent);
  color:var(--aa-ink);
  border: 1px solid var(--ah-accent);
  padding: 6px 10px;
  border-radius:11px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.ah-copy-btn:hover { background: var(--aa-info); }
.ah-copy-btn:active { opacity: .9; }

/* Tooltip */
.ah-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--ah-surface);
  color: var(--ah-text);
  border: 1px solid var(--ah-line);
  border-radius:11px;
  padding:11px 12px;
  max-width: min(420px, 90vw);
  box-shadow: 0 8px 20px rgba(30,27,22,.14);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}
.ah-tooltip .ah-multiple { font-weight: 700; }
.ah-tooltip .ah-multiple__value { font-size: 12px; }
.ah-tooltip__row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.ah-tooltip__small { color: var(--ah-muted); font-size: 11px; margin-top: 6px; }

/* Presentation slides */
.ah-slide-deck {
  height: calc(100vh - 140px);
  height: calc(100dvh - 140px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 0;
  margin: 0;
}
.ah-slide {
  scroll-snap-align: start;
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.ah-slide__inner {
  width: min(980px, 92vw);
  background: var(--ah-surface);
  border: 1px solid var(--ah-line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(30,27,22,.14);
}
.ah-slide__title {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.ah-slide__body {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ah-text);
}
.ah-slide__body p { margin:11px 0; }
.ah-slide__muted { color: var(--ah-muted); }
.ah-slide__links a { color: var(--ah-accent); text-decoration: none; }
.ah-slide__links a:hover { text-decoration: underline; }

