* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f5f7fa;
  color: #172033;
}

body {
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 72px;
  padding: 12px 20px;
  background: #101827;
  color: white;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.subtitle {
  margin-top: 4px;
  opacity: 0.7;
  font-size: 13px;
}

.status {
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  flex: 1;
  min-height: 0;
}

.controls,
.details {
  background: white;
  padding: 18px;
  overflow-y: auto;
}

.controls {
  border-right: 1px solid #dde3ea;
}

.details {
  border-left: 1px solid #dde3ea;
}

.controls section {
  margin-bottom: 26px;
}

h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  color: #5d6879;
}

.year-display {
  text-align: center;
  margin-bottom: 8px;
}

#yearValue {
  font-size: 34px;
  font-weight: 700;
}

#yearSlider {
  width: 100%;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #778293;
}

.metric {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 13px;
}

.controls label {
  display: block;
  margin: 8px 0;
  font-size: 13px;
}

.graph-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#network {
  display: block;
  width: 100%;
  height: 100%;
}

.loading {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  background: white;
  padding: 9px 14px;
  border-radius: 7px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.hidden {
  display: none;
}

.link {
  stroke: #8793a3;
  stroke-opacity: 0.42;
}

.node {
  cursor: pointer;
  stroke: white;
  stroke-width: 1.5px;
}

.node-label {
  pointer-events: none;
  font-size: 10px;
  fill: #263244;
  paint-order: stroke;
  stroke: white;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.detail-name {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-key {
  color: #788395;
  font-size: 12px;
  margin-bottom: 18px;
}

.detail-row {
  margin: 10px 0;
  font-size: 13px;
}

.detail-row span {
  display: block;
  color: #788395;
  font-size: 11px;
  margin-bottom: 2px;
}

.event-box {
  margin-top: 18px;
  padding: 12px;
  background: #f1f4f8;
  border-radius: 8px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .details {
    display: none;
  }
}
