:root {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171b22;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --border: #2a3140;
  --accent: #8ab4ff;
  --sensitive: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body {
  padding: 2rem;
  max-width: 72rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.lede,
.meta,
.status {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  border-bottom: 1px solid var(--border);
}

.tabs .tab {
  padding: 0.55rem 1rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font: inherit;
}

.tabs .tab:hover {
  color: var(--text);
}

.tabs .tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

section {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  scroll-margin-top: 1.25rem;
}

.tab-panel > section:first-child {
  margin-top: 1.25rem;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

input:not([type="range"]),
select,
button {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
}

input[type="search"] {
  min-width: 16rem;
}

.pager {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.sitelink-field {
  flex: 1 1 100%;
  max-width: 24rem;
  min-width: 16rem;
}

.sitelink-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sitelink-field-label {
  font-weight: 600;
}

.sitelink-field-value {
  color: var(--muted);
}

.slider {
  position: relative;
  height: 1.25rem;
  user-select: none;
  touch-action: none;
}

.slider-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.375rem;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--border);
}

.slider-range {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.slider-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

button.linkish,
a.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

a.linkish:hover {
  text-decoration: underline;
}

.check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.card.sensitive,
#person-detail.sensitive {
  outline: 1px solid var(--sensitive);
  outline-offset: 4px;
  border-radius: 6px;
  padding: 0.35rem;
}

.sensitivity-reason {
  margin: 0.2rem 0 0;
  color: var(--sensitive);
}

.card img,
.person-avatar-frame img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.person-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.person-heading h2 {
  margin: 0;
}

.person-avatar-frame,
.person-profile-frame {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.person-avatar-frame {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  font-size: 0.65rem;
  line-height: 1.15;
  padding: 0.2rem;
}

.person-avatar-frame.has-image,
.person-profile-frame.has-image {
  padding: 0;
  background: none;
  border: 0;
}

.person-profile-frame {
  flex: 0 0 16rem;
  width: 12rem;
  height: 16rem;
  min-height: 0;
  font-size: 0.9rem;
}

.person-profile-frame.has-image {
  width: auto;
  height: auto;
  max-width: 100%;
  min-height: 0;
  flex-basis: auto;
}

.credit {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.detail ul.source-links {
  list-style: none;
  margin: 0.35rem 0 0.75rem;
  padding: 0;
}

.source-links li {
  margin: 0.2rem 0;
}

.person-media {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, 42%);
  min-width: 0;
}

.person-media-link {
  display: grid;
  line-height: 0;
}

.detail ul {
  margin: 0;
  padding-left: 1.2rem;
}

.detail li {
  margin: 0.35rem 0;
}

.person-detail {
  display: flex;
  gap: 1.5rem;
  align-items: start;
}

.person-detail[hidden] {
  display: none;
}

.person-copy {
  flex: 1;
  min-width: 0;
}

.person-profile {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 24rem;
  object-fit: contain;
  object-position: top right;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}

@media (max-width: 40rem) {
  .person-detail {
    flex-direction: column;
  }

  .person-media {
    max-width: min(24rem, 100%);
    order: -1;
  }

  .person-profile-frame {
    width: 12rem;
    max-width: none;
  }

  .person-profile-frame.has-image {
    width: auto;
  }

  .person-profile {
    max-height: none;
  }
}

.summary-grid {
  display: grid;
  gap: 1rem;
}

.summary-grid > section {
  margin: 0;
}

.chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font: 12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.chart rect {
  fill: var(--accent);
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 2;
}

.chart-dot {
  stroke: var(--surface);
  stroke-width: 1.5;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.55rem;
}

.chart-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  cursor: help;
}

.chart-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.summary-table th,
.summary-table td {
  text-align: left;
  padding: 0.35rem 0.6rem 0.35rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
