:root {
  --accent: #00AA9B;
  --accent-hover: #009388;
  --text: #333;
  --text-sec: #555;
  --text-muted: #888;
  --border: #e0e0e0;
  --border-light: #eee;
  --bg: #fff;
  --radius: 10px;
}

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

html, body {
  height: 100%; width: 100%;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Layout ── */
#app {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}

#header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; gap: 10px; flex-wrap: wrap;
  background: var(--bg); border-bottom: 1px solid var(--border);
  z-index: 1000; flex-shrink: 0;
}

#title-area { display: flex; align-items: center; gap: 10px; }
#title-area img { height: 32px; }
#title-text { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.title-accent { color: var(--accent); }
.title-sub { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }

#header-controls { display: flex; align-items: center; gap: 8px; }

.info-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #999;
  background: none; color: #999; font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.info-btn:hover { border-color: var(--accent); color: var(--accent); }

#main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8px;
}

#chart_placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

#chart_placeholder svg {
  width: 100%; height: 100%;
}

/* ── Chord diagram ── */
#circle circle {
  fill: none;
  pointer-events: all;
}

path.chord {
  stroke: #000;
  stroke-width: 0.25px;
  transition: opacity 0.3s;
}

#circle:hover path.fade {
  opacity: 0;
}

.group text {
  fill: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
}

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 2000; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; }

.modal-container {
  background: var(--bg); border-radius: var(--radius); max-width: 520px; width: 90%;
  max-height: 75vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.modal-header h4 { font-size: 16px; color: var(--text); margin: 0; }

.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: #999;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 16px 20px; font-size: 13px; line-height: 1.6; color: #444;
}
.modal-body p { margin-bottom: 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body a { color: var(--accent); text-decoration: none; }
.modal-body a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 700px) {
  #header { padding: 6px 10px; }
  #title-text { font-size: 12px; }
  .title-sub { font-size: 10px; }
}
