/* What only the second group of tool pages needs beyond base.css: tokens and role sizes only. */
.tool-choice { margin-bottom: 20px; }
.tool-choice .chip-label { display: block; margin: 0 0 8px; }
.tool-hint { color: var(--muted); font-size: 0.875rem; margin: 6px 0 0; }
.tool-state { margin-bottom: 16px; }
.tool-message { margin: 0 0 16px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.tool-section-title { font-size: 1.0625rem; font-weight: 600; color: var(--heading); margin: 24px 0 8px; letter-spacing: -0.005em; }
.tool-result-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

/* A table of what-if values: the cell for the numbers entered is marked in words and colour. */
.data-table td.is-current { background: var(--accent-tint); color: var(--heading); font-weight: 600; }
.data-table th[scope="row"] { color: var(--heading); font-weight: 600; text-align: left; }
.data-table .row-mark td, .data-table .row-mark th { background: var(--accent-tint); color: var(--heading); font-weight: 600; }
.tool-inputs .chips { gap: 6px; }
.tool-inputs .chip { padding-inline: 12px; }

/* A results panel with a table beside its chart. */
.tool-pair { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1100px) { .tool-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.tool-pair .chart-wrap { min-width: 0; }
.data-table .is-ref td, .data-table .is-ref th { background: var(--accent-tint); color: var(--heading); font-weight: 600; }
.data-table td .row-open { display: inline-grid; place-items: center; vertical-align: middle; }
.data-table.tight td, .data-table.tight th { padding-inline: 8px; }
.data-table.tight td, .data-table.tight th { padding-block: 6px; }
.split > * { min-width: 0; }
@media (min-width: 1100px) { .tool-pair .chart-wrap { height: 400px; } }
.tool > *, .tool-pair > * { min-width: 0; }
.chart-wrap.chart-wrap--small { height: 220px; }
.tool-pair--charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (min-width: 1100px) { .tool-pair .chart-wrap.chart-wrap--small { height: 240px; } }

/* Data tools: filters on top, results below. */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 16px 20px; }
.filter-grid .field { margin-bottom: 0; }
.filter-range-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.filter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.th-sort:hover { color: var(--heading); }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--heading); font-weight: 600; }
.ticker-cell a { color: var(--heading); font-weight: 600; text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.ticker-cell .row-note { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 559.98px) { .ticker-cell .row-note { max-width: 7.5rem; } }
.tool-empty { text-align: center; padding: 40px 16px; }
.tool-empty i { color: var(--mark); font-size: 1.5rem; }
.filter-groups { display: grid; gap: 12px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-group .chip-label { min-width: 4.5rem; margin: 0; }
.data-table .row-open { display: inline-grid; place-items: center; }
.data-table .row-open[aria-expanded="true"] i { transform: rotate(180deg); }
.chart-wrap--ring { height: 260px; }
/* A hidden table heading is absolutely placed: keep it inside the scrolling table, or a phone's page widens. */
.table-wrap { position: relative; }
.tool-pair .chart-wrap.chart-wrap--ring { height: 260px; }
/* A row's details stay in view on a phone, however wide the table scrolls. */
.detail-fit { position: sticky; left: 16px; width: min(100%, calc(100vw - 72px)); }
