*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #fff;
  color: #222;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

#viz {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#viz svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
#details {
  width: 400px;
  flex-shrink: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #444;
}

#details-content {
  flex: 1;
  overflow-y: auto;
  background: #f5f6f7;
  border-radius: 6px;
  padding: 1rem;
}

#config-panel {
  flex-shrink: 0;
  background: #f5f6f7;
  border-radius: 6px;
  padding: 1rem;
}

#details h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #3a3a3a;
}

#details h3 {
  margin: 0.75rem 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}

#details p {
  margin: 0 0 0.25rem;
}

#details .meta-item {
  margin-bottom: 0.25rem;
}

#details .error {
  color: #c00;
}

.activity-title {
  font-weight: 500;
  margin: 0 0 0.5rem;
}

.quote {
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #444;
  background: #fff;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  margin-top: 0.25rem;
}

/* Lock indicator in details heading */
.lock-tag {
  font-size: 0.72rem;
  font-weight: 400;
  color: #999;
  letter-spacing: 0.01em;
}

/* ── Config panel controls ────────────────────────────────────────────────── */
.config-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.config-group + .config-group {
  margin-top: 0.75rem;
}

.config-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}

.btn-group {
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #d0d0d0;
}

.btn-ctrl {
  flex: 1;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-family: inherit;
  background: #fff;
  border: none;
  border-right: 1px solid #d0d0d0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  line-height: 1.4;
}

.btn-ctrl:last-child {
  border-right: none;
}

.btn-ctrl.active {
  background: #1E5AF5;
  color: #fff;
}

.btn-ctrl:hover:not(.active) {
  background: #e8e8e8;
}

/* Separated (independent toggle) variant for #type-filter */
#type-filter {
  gap: 0.4rem;
  border: none;
  overflow: visible;
}

#type-filter .btn-ctrl {
  border: 1px solid #d0d0d0;
  border-radius: 4px;
}

#type-filter .btn-ctrl:last-child {
  border-right: 1px solid #d0d0d0;
}

/* ── Viz title ───────────────────────────────────────────────────────────── */
.viz-title {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 24px;
  font-weight: 500;
  fill: #555;
  letter-spacing: 0.03em;
  pointer-events: none;
}

/* ── Arc and ribbon styles ───────────────────────────────────────────────── */
.arc {
  cursor: pointer;
  transition: opacity 0.15s;
}

.arc-label {
  font-size: 11px;
  fill: #333;
  pointer-events: none;
}

/* ── Ribbons ─────────────────────────────────────────────────────────────── */
.ribbon {
  opacity: 0.28;
  stroke-width: 0.5px;
  cursor: pointer;
  transition: opacity 0.15s, stroke-width 0.15s;
}

/* Class-based states — applied by applyVisualState(), no :hover override */
.ribbon--dim       { opacity: 0.05; }
.ribbon--highlight { opacity: 0.7; stroke-width: 1.25px; }

/* ── Arc group states ─────────────────────────────────────────────────────── */
.group--dim       { opacity: 0.45; }
.group--highlight { opacity: 1; }

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
#tooltip {
  display: none;
  position: fixed;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 100;
}
