body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  max-width: 1090px;
  margin: 2rem auto;
  padding: 0 2rem;
  line-height: 1.7;
  color: #222;
  background: #fafafa;
}
h1 {
  font-size: 1.8rem;
  padding-bottom: 0.4rem;
}

.question {
  color: #313131 !important;
}

.at-pair {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
li {
  margin-bottom: 0.8rem;
}

hr {
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.3rem;
}
h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  color: #1a1a1a;
}
h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
  color: #333;
}
h4 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.92rem;
}
th,
td {
  border: 1px solid #ccc;
  padding: 0.5rem 0.7rem;
  text-align: left;
}
th {
  background: #eee;
  font-weight: 600;
}

tr:nth-child(even) {
  background: #f7f7f7;
}

blockquote {
  border-left: 4px solid #888;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
}

code {
  background: #e8e8e8;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.code-title {
  background: #e8e8e8;
  padding: 0.1rem 2rem;
  border-radius: 5px;
  font-size: 1em;
  width: fit-content;
  display: flex;
  justify-self: center;
}
a {
  color: #0066cc;
}
hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 2rem 0;
}
.header {
  text-align: center;
  margin-bottom: 2rem;
}
.header h3 {
  color: #555;
  margin: 0.2rem 0;
}

.crossing-label {
  font-size: 0.6rem;
  fill: #333;
  pointer-events: none;
}

.prelim-charts-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.prelim-charts-row > div {
  flex: 1;
  min-width: 300px;
}

#prelim-generation-lines svg,
#prelim-generation-bars svg {
  background: #f9fafb;
  border-radius: 6px;
  width: 100%;
}

#design1-container {
  position: relative;
  margin: 2rem 0;
  border: 1px #ccc solid;
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
}

#design1-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

#design1-controls label {
  font-size: 0.85rem;
  color: #555;
}

#design1-controls input[type="range"] {
  width: 200px;
}

#design1-toggle {
  padding: 0.4rem 1rem;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}

#design1-toggle:hover {
  background: #eee;
}

#design1-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 10;
}

#design1-year-display {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 2.5rem;
}

.design1-legend {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #555;
}

.design1-legend rect {
  stroke: #ccc;
  stroke-width: 0.5;
}

#design-container {
  position: relative;
  border-radius: 2rem;
  border: 1px #ccc solid;
  padding: 2rem 1rem;
  background-color: #fff;
}

#design2-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

#design2-controls input[type="range"] {
  width: 200px;
}

#design2-controls label {
  font-size: 0.85rem;
  color: #555;
}

#design2-year-display {
  font-weight: 600;
  font-size: 0.95rem;
}

#design2-views {
  display: grid;
  grid-template-columns: 200px 1fr 260px;
  grid-template-rows: auto;
  gap: 0.5rem;
  align-items: start;
}

#design2-donut {
  justify-self: center;
}

#design2-map svg,
#design2-bars svg {
  background: #fff;
  border-radius: 4px;
  width: 100%;
}

#design2-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 10;
}

#design2-bars .bar-label {
  font-size: 0.7rem;
  fill: #333;
}

#design2-bars .bar-value {
  font-size: 0.65rem;
  fill: #666;
}

.design2-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.design2-view-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #444;
}

.design2-dropdown {
  font-size: 0.7rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #333;
  cursor: pointer;
}

#design2-legend {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0 0;
}

#design2-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: #555;
}

#design2-legend .legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

#design3-container {
  position: relative;
  margin: 2rem 0;
  border: 1px #ccc solid;
  padding: 2rem 1rem;
  background-color: #fff;
  border-radius: 1rem;
}

#design3-container svg {
  background: #fff;
}

#design3-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

#design3-controls button {
  padding: 0.4rem 1rem;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}

#design3-controls button:hover {
  background: #eee;
}

#design3-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 10;
}
