:root {
  --bg: #fafafa;
  --fg: #222;
  --muted: #666;
  --accent: #007cba;
  --pole-a: #1f77b4;   /* positive pole: blue  */
  --pole-b: #d97706;   /* negative pole: orange */
  --card-bg: #fff;
  --card-border: #ddd;
  --panel-bg: #f2f2f2;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  max-width: 780px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

h1 { text-align: center; margin-bottom: 4px; }
h1 + p { text-align: center; color: var(--muted); margin-top: 0; }

.intro {
  background: var(--panel-bg);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 20px 0;
}
.intro p { margin: 6px 0; }

.rule {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  margin: 14px 0;
  padding: 16px 18px;
  border-radius: 6px;
}

.rule .statement {
  font-weight: 600;
  font-size: 1.05em;
  margin-bottom: 6px;
}

.rule .logic {
  color: var(--muted);
  font-size: 0.93em;
  margin-bottom: 12px;
}

.scale {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.scale label {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 6px 8px;
  font-size: 0.85em;
  text-align: center;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  user-select: none;
  transition: background 0.1s;
}
.scale label:hover { background: #f0f7ff; }
.scale input { display: none; }
.scale label:has(input:checked) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#calculate {
  display: block;
  width: 100%;
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  margin: 24px 0;
}
#calculate:hover { filter: brightness(1.1); }

#results {
  background: var(--panel-bg);
  padding: 20px;
  border-radius: 6px;
  margin-top: 20px;
  display: none;
}
#results.visible { display: block; }

#results h2 { margin-top: 0; }

.axis {
  margin: 10px 0;
}
.axis-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  margin-bottom: 3px;
  color: var(--muted);
}
.axis-label-neg { color: var(--pole-b); }
.axis-label-pos { color: var(--pole-a); }

.axis-bar {
  height: 18px;
  background: #e8e8e8;
  border-radius: 9px;
  position: relative;
  overflow: hidden;
}
.axis-bar-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #aaa;
}
.axis-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent);
  opacity: 0.75;
}
.axis-fill.positive { left: 50%; background: var(--pole-a); }
.axis-fill.negative { right: 50%; background: var(--pole-b); }

.axis-score {
  font-size: 0.85em;
  color: var(--muted);
  margin-top: 3px;
  text-align: center;
}

.summary {
  margin-top: 16px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  font-size: 0.95em;
}

.movement {
  background: #fff;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 10px 0;
}
.movement-name {
  font-weight: 600;
  font-size: 1.05em;
  margin-bottom: 4px;
}
.movement-similarity {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9em;
}
.movement-blurb {
  color: var(--muted);
  font-size: 0.93em;
  line-height: 1.5;
}
