/* layout.css — page chrome, SVG chart styling, node/line/label rules. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

body {
  transition: background 0.2s ease, color 0.2s ease;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

/* Full-width header with an edge-to-edge divider — the rule spans the
   whole viewport, while the title/toggle stay aligned with the chart
   content below via .page-header-inner's matching max-width. */
.page-header {
  border-bottom: 1px solid var(--border);
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 1.5rem;
}

.theme-toggle {
  width: 40px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.theme-toggle-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.2s ease;
}

:root[data-theme="dark"] .theme-toggle-dot {
  transform: translateX(16px);
}

.chart-frame {
  /* No border/background of its own — sits directly on the page background
     (var(--bg)) rather than reading as a boxed card, per Nereeda's request. */
  position: relative;
  padding: var(--space-4);
  overflow: hidden;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  fill: var(--text);
}

.chart-line {
  stroke-width: 1.5;
  /* Each line reuses its node's own color (set inline by chart.js) at 72%
     opacity, per the C-Design spec — not a fixed color of its own. */
  opacity: 0.72;
}

.node {
  cursor: pointer;
  outline: none;
}

.node-circle {
  stroke-width: 1.5;
  /* Fully opaque — the C-Design hex values are the exact intended color,
     not a base to dim/blend further. */
}

.node-label {
  font-family: var(--font-sans);
  font-size: 13px;
  /* Fixed white, not var(--text) — the label sits on top of its own
     saturated circle fill in both themes, not the page background. */
  fill: #ffffff;
}
