/* Copyright (c) 2026 Tax Policy Associates Ltd
 * Released under the MIT Licence. See LICENCE in the project root. */
body {
  margin: 0;
  padding: 0;
  /* flow-root so the heading's top margin cannot collapse out through the body
     and leave the embedding frame a few pixels short. */
  display: flow-root;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: #fff;
  color: #1b1b1b;
}

#iht-swing {
  --ink: #1b1b1b;
  --muted: #5a6468;
  --line: #d8dcdd;
  --accent: #1a606d;
  --panel: #fbfcfc;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.6rem 4px 0.5rem;
}
#iht-swing * { box-sizing: border-box; }

#iht-swing h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 1.2rem;
}

/* Controls on the left, chamber on the right. They stack below 860px, where
   two columns would leave the hemicycle too small to read. */
.swing-body {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 1rem;
  align-items: stretch;
}

.swing-panel {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  padding: 1.1rem 1.15rem;
}

.swing-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.3rem;
}

.swing-view { display: flex; flex-direction: column; justify-content: center; }
.swing-chamber svg { display: block; width: 100%; height: auto; }

/* The result, stated rather than assumed: the text is built from whatever the
   model returns, so it changes if the answer does. */
.swing-result {
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.4;
  margin: 0.4rem auto 0.9rem;
  max-width: 30rem;
}
.swing-result strong { font-weight: 600; }
.swing-result em { font-style: normal; color: var(--muted); display: block;
                   font-size: 0.85rem; margin-top: 0.2rem; }

.swing-chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.28rem 0.9rem; font-size: 0.79rem;
}
.swing-chip { display: flex; align-items: baseline; gap: 0.3rem; }
.swing-chip i { width: 0.6rem; height: 0.6rem; border-radius: 50%;
                display: inline-block; flex: 0 0 auto; align-self: center; }
.swing-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.swing-chip s { text-decoration: none; color: var(--muted);
                font-variant-numeric: tabular-nums; }

.swing-control label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.87rem; line-height: 1.35; margin-bottom: 0.4rem;
}
.swing-control .value {
  margin-left: auto; padding-left: 0.4rem;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.95rem;
  white-space: nowrap;
}
.swing-control input[type=range] {
  width: 100%; accent-color: var(--accent); height: 1.3rem; margin: 0;
  display: block;
}

/* The information button and its note. One per control, and nothing else on
   screen, so the labels can stay short. */
.swing-info {
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 1px solid var(--muted); background: none; color: var(--muted);
  font-size: 0.72rem; line-height: 1; font-family: inherit;
  cursor: pointer; padding: 0; flex: 0 0 auto;
}
.swing-info:hover, .swing-info[aria-expanded=true] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.swing-note {
  margin: 0.5rem 0 0; padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--accent); background: #eef4f4;
  font-size: 0.83rem; line-height: 1.5; color: #333;
}
.swing-note[hidden] { display: none; }

/* The figure that sits in the hollow of the chamber. */
.swing-effect-label { font-size: 0.045px; fill: #5a6468; }
.swing-effect-value { font-size: 0.095px; fill: #0087dc; font-weight: 700; }

@media (max-width: 860px) {
  .swing-body { grid-template-columns: minmax(0, 1fr); }
  .swing-controls { order: 2; }
  .swing-view { order: 1; }
}
@media (max-width: 560px) {
  #iht-swing { padding-top: 1.1rem; }
  .swing-chips { gap: 0.22rem 0.7rem; font-size: 0.75rem; }
  .swing-result { font-size: 0.96rem; }
}

/* The children toggle. A switch rather than a slider, because whether to count
   them at all is a judgement and not a quantity. */
.swing-toggle label { gap: 0.5rem; cursor: pointer; }
.swing-toggle input[type=checkbox] {
  width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent);
  flex: 0 0 auto; cursor: pointer;
}
