/* Survey (widgets/survey/survey.js): one question at a time, for everyone, in a compact box that is dark on a light
   page and light on a dark one (like the interviews): Chicago Maroon on a light page, light on the maroon dark
   page. The frame redefines the site tokens, so everything inside follows the box; single-series bars use --mark
   (Virginia Tech Burnt Orange on maroon, Chicago Maroon on light). Categorical slots are the validated default
   palette for the box's surface (on maroon they fall under 3:1, so every chart keeps its value labels). */
.strip > .pic--survey {
  --tile-bg: #861f41; --bg: #861f41; --ink: #fff; --ink-2: #f6e9ee; --muted: #e2c2cd; --line: rgba(255,255,255,.24); --mark: #e5751f;
  color-scheme: dark;
}
html[data-theme=dark] .strip > .pic--survey {
  --tile-bg: #ececec; --bg: #ececec; --ink: #292b34; --ink-2: #44464f; --muted: #5f616a; --line: #cbcbcf; --mark: #861f41;
  color-scheme: light;
}
.sv {
  --sv-c1: #3987e5; --sv-c2: #d95926; --sv-c3: #199e70; --sv-c4: #c98500;
  --sv-c5: #d55181; --sv-c6: #008300; --sv-c7: #9085e9; --sv-c8: #e66767;
  --sv-other: #c09aa7;
  container-type: size;
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px 18px;
  font-size: 12.5px; line-height: 1.35; color: var(--ink); text-align: left;
}
html[data-theme=dark] .sv {
  --sv-c1: #2a78d6; --sv-c2: #eb6834; --sv-c3: #1baf7a; --sv-c4: #eda100;
  --sv-c5: #e87ba4; --sv-c6: #008300; --sv-c7: #6250d6; --sv-c8: #e34948;
  --sv-other: #a3a5ab;
}
.sv button { font: inherit; color: inherit; }

.sv__top { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.sv__head { display: flex; align-items: baseline; gap: 8px; }
.sv__eyebrow { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sv__total { font-size: 15px; font-weight: 600; }
.sv__weight { color: var(--muted); font-size: 11.5px; }
.sv__view { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sv__group { margin-bottom: 4px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sv__nav { display: flex; align-items: center; gap: 10px; }
.sv__arrow { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2) !important; font-size: 14px !important; }
.sv__arrow:hover, .sv__arrow:focus-visible { box-shadow: inset 0 0 0 1px var(--ink-2); color: var(--ink) !important; outline: none; }
.sv__count { min-width: 4.5em; text-align: center; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sv__title { margin: 0; font-size: 14px; line-height: 1.25; font-weight: 500; }
.sv__sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.sv__chart { position: relative; flex: 1; min-height: 0; margin-top: 10px; }
.sv__kicker { margin-bottom: 8px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sv__note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }

/* Legend rows (pie, NPS) */
.sv__leg { display: grid; grid-template-columns: 10px minmax(0, 1fr) 44px; align-items: center; gap: 10px; padding: 3px 0; color: var(--ink-2); }
.sv__leg.is-on { color: var(--ink); font-weight: 600; }
.sv__sw { width: 10px; height: 10px; border-radius: 50%; }
.sv__leg-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.sv__leg-n { display: none; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }

/* Pie */
.sv__pie { display: flex; align-items: center; gap: 20px; height: 100%; }
.sv__donut-wrap { position: relative; flex: none; height: min(100%, 240px); aspect-ratio: 1; }
.sv__donut { display: block; width: 100%; height: 100%; overflow: visible; }
.sv__slice { stroke: var(--tile-bg); stroke-width: 2; stroke-linejoin: round; transition: opacity .2s ease; }
.sv__slice.is-dim { opacity: .35; }
.sv__mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 22%; text-align: center; pointer-events: none; }
.sv__mid strong { font-size: 26px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.sv__mid span { margin-top: 2px; font-size: 11px; line-height: 1.2; color: var(--ink-2); }
.sv__legend { flex: 1; min-width: 0; max-width: 300px; }

/* Bars */
.sv__bars { display: flex; flex-direction: column; gap: 7px; max-height: 100%; overflow-y: auto; padding-right: 4px; }
.sv__bar-row { display: grid; grid-template-columns: minmax(90px, 40%) minmax(0, 1fr); align-items: center; gap: 12px; }
.sv__bar-label { text-align: right; color: var(--ink-2); line-height: 1.2; }
.sv__track { position: relative; height: 14px; margin-right: 42px; }
.sv__bar { width: 0; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--mark); transition: width .45s cubic-bezier(.2,.7,.2,1); }
.sv__bar.is-other { background: var(--sv-other); }
.sv__val { position: absolute; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.sv__track .sv__val { top: 50%; transform: translateY(-50%); transition: left .45s cubic-bezier(.2,.7,.2,1); }

/* Columns (ordered answers) */
.sv__cols { display: flex; gap: 6px; height: 100%; padding-top: 18px; }
.sv__col { flex: 1; max-width: 96px; display: flex; flex-direction: column; min-height: 0; }
.sv__col-area { position: relative; flex: 1; min-height: 0; border-bottom: 1px solid var(--line); }
.sv__colbar { position: absolute; bottom: 0; left: 50%; width: min(64%, 40px); height: 0; transform: translateX(-50%); border-radius: 4px 4px 0 0; background: var(--mark); transition: height .45s cubic-bezier(.2,.7,.2,1); }
.sv__col-area .sv__val { left: 0; right: 0; text-align: center; transition: bottom .45s cubic-bezier(.2,.7,.2,1); }
.sv__col-label { margin-top: 6px; min-height: 2.4em; text-align: center; font-size: 11px; line-height: 1.2; color: var(--ink-2); }

/* Net promoter score: the score and the three groups in one row, the columns under them. */
.sv__nps { display: flex; flex-direction: column; gap: 4px; height: 100%; }
.sv__hero { flex: none; display: flex; align-items: center; gap: 10px 14px; }
.sv__hero strong { font-size: 34px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.sv__hero-label { max-width: 5.5em; line-height: 1.15; font-size: 11.5px; color: var(--ink-2); }
.sv__nps-legend { display: flex; flex-direction: column; margin-left: auto; font-size: 11.5px; }
.sv__nps-legend .sv__leg { grid-template-columns: 8px minmax(0, 1fr) 34px; gap: 6px; padding: 0; }
.sv__nps-cols { flex: 1; min-width: 0; min-height: 0; }
.sv__nps .sv__col-label { min-height: 0; }
.sv__colbar.is-det, .sv__sw--det { background: var(--sv-other); }
.sv__colbar.is-pas, .sv__sw--pas { background: color-mix(in srgb, var(--mark) 45%, var(--tile-bg)); }
.sv__colbar.is-pro, .sv__sw--pro { background: var(--mark); }

/* Tooltip */
.sv__tip { position: absolute; top: 0; left: 0; z-index: 5; display: flex; flex-direction: column; gap: 1px; max-width: 240px; padding: 6px 9px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.3; pointer-events: none; }
.sv__tip[hidden] { display: none; }
.sv__tip strong { font-weight: 600; }

/* Narrow or short frames */
@container (max-width: 480px) {
  .sv { padding: 12px 12px 10px 14px; }
  .sv__pie { gap: 12px; }
  .sv__legend { font-size: 11px; }
  .sv__leg { grid-template-columns: 8px minmax(0, 1fr) 38px; gap: 6px; }
}
@container (max-height: 330px) {
  .sv__group, .sv__sub { display: none; }
  .sv__chart { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .sv__bar, .sv__colbar, .sv__val, .sv__slice { transition: none !important; }
}
