/* Roll-call dots — Inside Michigan, Energy Files.
   Uses the site's tokens (--page, --paper, --ink, --ink-2, --muted, --line, --accent,
   --accent-text, --accent-soft, --lake, --flame) so it follows the host page's theme.
   Vote colours are the ones the-law page already uses: yes = --lake, no = --flame,
   excused = dashed --muted. Shape repeats the encoding: circle, square, open dashed circle. */
[data-widget="roll-calls"] {
	max-width: 68rem;
	color: var(--ink);
	font-size: 1rem;
	line-height: 1.5;
}
[data-widget="roll-calls"] *,
[data-widget="roll-calls"] *::before,
[data-widget="roll-calls"] *::after { box-sizing: border-box; }

.rcd-eyebrow {
	margin: 0 0 .4rem;
	color: var(--accent-text);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.rcd-title {
	margin: 0;
	font-family: "Iowan Old Style", Charter, "Bitstream Charter", "Palatino Linotype", Georgia, serif;
	font-size: clamp(1.6rem, 4.6vw, 2.4rem);
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.08;
}
.rcd-lede { max-width: 64ch; margin: .6rem 0 1.1rem; color: var(--ink-2, var(--ink)); }

/* ---- static version (what a reader without JavaScript gets) ---- */
.rcd-static { display: grid; gap: 1.1rem; }
.rcd-tally, .rcd-table {
	width: 100%;
	max-width: 44rem;
	border-collapse: collapse;
	font-size: .9375rem;
}
.rcd-tally caption, .rcd-table caption { padding: 0 0 .45rem; text-align: left; }
.rcd-cap-title { display: block; font-weight: 700; }
.rcd-cap-sub { display: block; color: var(--muted); font-size: .8125rem; }
.rcd-tally th, .rcd-tally td, .rcd-table th, .rcd-table td {
	padding: .45rem .7rem .45rem 0;
	border-top: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}
.rcd-tally thead th, .rcd-table thead th {
	border-top: 0;
	color: var(--muted);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.rcd-tally tbody th { font-weight: 700; }
.rcd-tally td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 700; }
.rcd-note, .rcd-rc-note { max-width: 70ch; margin: 0; color: var(--muted); font-size: .875rem; }
.rcd-sponsors h3 { margin: 0 0 .3rem; font-size: 1rem; line-height: 1.35; }
.rcd-sponsors p { margin: 0 0 .4rem; }
.rcd-sponsors ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.rcd-sponsors li {
	padding: .25rem .7rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
	font-size: .8125rem;
}
.rcd-read, .rcd-src {
	max-width: 78ch;
	margin: .8rem 0 0;
	color: var(--muted);
	font-size: .8125rem;
	line-height: 1.55;
}
.rcd-read strong, .rcd-src strong { color: var(--ink-2, var(--ink)); }

/* ---- controls ---- */
.rcd-ui { display: grid; gap: .85rem; margin: 0 0 1rem; }
.rcd-seg { min-width: 0; margin: 0; padding: 0; border: 0; }
.rcd-seg legend, .rcd-search label {
	display: block;
	margin: 0 0 .3rem;
	padding: 0;
	color: var(--muted);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.rcd-seg-row { display: flex; flex-wrap: wrap; gap: 0; }
.rcd-opt { position: relative; display: flex; flex: 1 1 auto; margin: 0 -1px -1px 0; cursor: pointer; }
.rcd-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rcd-opt-face {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: center;
	min-height: 44px;
	padding: .4rem .85rem;
	border: 1px solid var(--line);
	background: var(--paper);
	color: var(--ink-2, var(--ink));
	font-size: .9375rem;
	line-height: 1.25;
}
.rcd-opt-main { font-weight: 700; }
.rcd-opt-sub { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.rcd-opt input:checked + .rcd-opt-face {
	position: relative;
	z-index: 1;
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--ink);
	box-shadow: inset 0 -3px 0 var(--accent);
}
.rcd-opt input:checked + .rcd-opt-face .rcd-opt-main::before { content: "✓ "; }
.rcd-opt input:focus-visible + .rcd-opt-face { z-index: 2; outline: 3px solid var(--ink); outline-offset: 2px; }
.rcd-switch .rcd-opt { flex: 1 1 13rem; }
.rcd-filters { display: flex; flex-wrap: wrap; gap: .85rem 1.4rem; align-items: flex-end; }
.rcd-search { flex: 1 1 12rem; min-width: 0; max-width: 20rem; }
.rcd-search input {
	width: 100%;
	min-height: 44px;
	padding: .4rem .7rem;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	font-size: 1rem;
}
.rcd-search input:focus-visible, .rcd-step:focus-visible, .rcd-text summary:focus-visible, .rcd-names summary:focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 2px;
}
.rcd-found {
	margin: 0;
	padding: .55rem .8rem;
	border-left: .3rem solid var(--accent);
	background: var(--accent-soft);
	color: var(--ink);
	font-size: .9375rem;
}

/* ---- heading and summary ---- */
.rcd-head { margin-top: .2rem; }
.rcd-rc-title { margin: 0; color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.rcd-rc-sub { margin: .1rem 0 0; color: var(--muted); font-size: .8125rem; }
.rcd-summary { position: relative; margin: 0; color: var(--ink); font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.rcd-compare { max-width: 78ch; margin: 0; color: var(--ink-2, var(--ink)); font-size: .9375rem; }

/* ---- the chamber ---- */
.rcd-stage { padding: .8rem .9rem 1rem; border: 1px solid var(--line); background: var(--paper); }
.rcd-inner { position: relative; }
.rcd-blocks { position: relative; height: 1.5rem; max-width: 100%; }
.rcd-block-label {
	position: absolute;
	top: 0;
	overflow: hidden;
	color: var(--muted);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .04em;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.rcd-grid { position: relative; max-width: 100%; }
.rcd-dot {
	position: absolute;
	top: 0;
	left: 0;
	width: var(--rcd-d);
	height: var(--rcd-d);
	margin: var(--rcd-pad);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lake);
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: transform .5s cubic-bezier(.3, .8, .3, 1), border-radius .35s ease, background-color .35s ease, opacity .3s ease, box-shadow .2s ease;
}
/* the hit area is the whole grid cell, not just the drawn dot */
.rcd-dot::after { position: absolute; inset: calc(var(--rcd-pad) * -1); content: ""; }
.rcd-v-yes { border-radius: 50%; background: var(--lake); }
.rcd-v-no { border-radius: 2px; background: var(--flame); }
.rcd-v-nv { border: 2px dashed var(--muted); border-radius: 50%; background: transparent; }
.rcd-dot.rcd-dim { opacity: .14; cursor: default; }
.rcd-dot.rcd-enter, .rcd-dot.rcd-leave { opacity: 0; }
.rcd-changed { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent-text, var(--accent)); }
.rcd-dot:hover:not(.rcd-dim) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.rcd-dot.rcd-sel { z-index: 2; box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px var(--ink); }
.rcd-dot.rcd-changed.rcd-sel { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent-text, var(--accent)), 0 0 0 6px var(--paper), 0 0 0 8px var(--ink); }
.rcd-dot:focus { outline: none; }
.rcd-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rcd-dot:focus-visible { z-index: 3; outline: 3px solid var(--ink); outline-offset: 4px; }
.rcd-tip {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 5;
	max-width: min(22rem, 100%);
	padding: .3rem .6rem;
	border: 1px solid var(--line);
	background: var(--ink);
	color: var(--page);
	font-size: .8125rem;
	font-weight: 600;
	line-height: 1.3;
	pointer-events: none;
}

/* ---- key ---- */
.rcd-key {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem 1.2rem;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--ink-2, var(--ink));
	font-size: .875rem;
}
.rcd-key li { display: flex; align-items: center; gap: .45rem; }
.rcd-key strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.rcd-swatch { display: inline-block; flex: none; width: 14px; height: 14px; margin: 0 4px; }

/* ---- selected dot ---- */
.rcd-detail {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: .6rem;
	align-items: center;
	padding: .6rem;
	border: 1px solid var(--line);
	background: var(--paper);
}
.rcd-detail-text { min-width: 0; margin: 0; color: var(--ink); font-size: .9375rem; }
.rcd-step {
	min-width: 44px;
	min-height: 44px;
	padding: .3rem .8rem;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--page);
	color: var(--ink);
	font: inherit;
	font-size: .875rem;
	font-weight: 700;
	cursor: pointer;
}
.rcd-step:hover { border-color: var(--accent); }
.rcd-step:disabled { opacity: .45; cursor: default; }

/* ---- text version ---- */
.rcd-text { margin: 0; border: 1px solid var(--line); background: var(--paper); }
.rcd-text summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: .4rem .9rem;
	font-size: .9375rem;
	font-weight: 700;
	cursor: pointer;
}
.rcd-text[open] summary { border-bottom: 1px solid var(--line); }
.rcd-text .rcd-static, .rcd-text .rcd-gen:not(:empty) { padding: .9rem; }
.rcd-text .rcd-sponsors li { background: var(--page); }
.rcd-gen .rcd-table { max-width: none; }

/* ---- every member's vote, by name (one closed <details> per roll call) ---- */
.rcd-names { max-width: 44rem; margin: -.4rem 0 0; border: 1px solid var(--line); }
.rcd-names summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: .4rem .8rem;
	font-size: .9375rem;
	font-weight: 700;
	cursor: pointer;
}
.rcd-names[open] summary { border-bottom: 1px solid var(--line); }
.rcd-names > p, .rcd-names > ul { margin: 0; padding: 0 .8rem; }
.rcd-names .rcd-names-src { padding-top: .6rem; color: var(--muted); font-size: .875rem; }
.rcd-names .rcd-names-vote { padding-top: .8rem; font-size: .9375rem; }
.rcd-names .rcd-names-party { padding-top: .25rem; color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rcd-names-list { columns: 15rem; column-gap: 1.5rem; list-style: none; font-size: .9375rem; line-height: 1.45; }
.rcd-names-list li { break-inside: avoid; padding: .1rem 0; }
.rcd-names-d, .rcd-names-why { color: var(--muted); font-size: .875rem; }
.rcd-names > .rcd-names-list:last-child, .rcd-names > p:last-child { padding-bottom: .8rem; }
.rcd-text .rcd-names { margin: 0; background: var(--page); }

@media (max-width: 560px) {
	.rcd-detail { grid-template-columns: 1fr 1fr; }
	.rcd-detail-text { grid-column: 1 / -1; grid-row: 1; }
	.rcd-filters { gap: .7rem; }
	.rcd-seg, .rcd-search { flex: 1 1 100%; max-width: none; }
	.rcd-switch .rcd-opt { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.rcd-dot { transition: none; }
}
@media (forced-colors: active) {
	.rcd-v-yes, .rcd-v-no { background: CanvasText; forced-color-adjust: none; }
	.rcd-v-nv { border-color: CanvasText; }
	.rcd-opt input:checked + .rcd-opt-face { outline: 2px solid Highlight; }
}
