/* Twitch Bits to USD: the shared finance panel plus quick amounts, purchase cards, the price-list switch,
   reference tables, cheer swatches, price editing and sources. Colors come from the shared tokens, so the
   panel follows the light and dark themes; the swatches take Twitch's tier colors from the data module. */
@import url('/src/utils/financeCalculator.css');
.tbu [hidden] { display: none !important; }
.tbu .tbu-use { margin-top: 1.1rem; max-width: 36rem; grid-template-columns: 1fr; }

.tbu-quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.tbu .tbu-quick button { padding: .4rem .9rem; font-family: var(--font-mono); border-radius: 999px; }
.tbu .tbu-quick button:hover { background: var(--pastel-yellow); }

.tbu-combos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .75rem; margin-top: 1rem; }
.tbu-combos:empty { display: none; }
.tbu-combo { display: grid; align-content: start; gap: .2rem; min-width: 0; padding: .75rem .9rem; background: var(--bg-2); border: 2px solid var(--line); border-radius: 8px; box-shadow: 3px 3px 0 var(--shade); }
.tbu .tbu-combo p { color: var(--ink); }
.tbu .tbu-combo .tbu-combo-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.tbu .tbu-combo .tbu-combo-packs { font: 700 1.05rem var(--font-mono); overflow-wrap: anywhere; }
.tbu .tbu-combo .tbu-combo-note { font-size: .85rem; color: var(--ink-soft); }

.tbu-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; margin: 1rem 0 0; padding: 0; border: 0; }
.tbu-switch legend { width: 100%; margin-bottom: .4rem; padding: 0; font-size: .85rem; font-weight: 650; }
.tbu-switch label { position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: .35rem .9rem; font-size: .9rem; font-weight: 650; background: var(--bg-2); border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.tbu-switch input { position: absolute; opacity: 0; pointer-events: none; }
.tbu-switch label:has(input:checked) { color: var(--on-action); background: var(--action); box-shadow: 2px 2px 0 var(--shade); }
.tbu-switch label:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }

.tbu .fin-table-wrap:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tbu .tbu-caption { position: sticky; left: 0; max-width: 100%; margin: 0; padding: .55rem .7rem; font-size: .85rem; font-weight: 700; color: var(--ink); }
.tbu .tbu-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbu .tbu-best th, .tbu .tbu-best td { font-weight: 750; color: var(--ink); background: var(--pastel-yellow); }
.tbu-ref { display: grid; gap: 1rem; margin-top: 1.5rem; }
.tbu-ref h3 { margin: 0; }
.tbu .tbu-ref .fin-table-wrap { max-height: none; margin-top: 0; }
.tbu-ref-grid { display: grid; gap: 1rem; }
.tbu-ref-grid > * { min-width: 0; }
.tbu .tbu-sub { display: block; margin-top: .1rem; font-size: .76rem; font-weight: 500; color: var(--ink-soft); }
.tbu-swatch { display: inline-block; width: .95rem; height: .95rem; margin-right: .45rem; vertical-align: -.12rem; border: 1.5px solid var(--line); border-radius: 3px; }

.tbu-advanced { margin-top: 1.25rem; padding: .85rem 1rem; background: var(--paper-3); border: 2px solid var(--line); border-radius: 10px; }
.tbu-advanced > * + * { margin-top: .9rem; }
.tbu-advanced summary { min-height: 1.6rem; font-weight: 700; cursor: pointer; }
.tbu-advanced summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tbu-advanced.tbu-is-edited summary::after { content: ' · edited'; font-weight: 600; color: var(--ink-soft); }
.tbu .tbu-advanced p { font-size: .9rem; color: var(--ink); }
.tbu fieldset.tbu-prices { min-width: 0; margin: .9rem 0 0; padding: .75rem; border: 1.5px solid var(--border-soft); border-radius: 8px; }
.tbu-price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem .9rem; }

.tbu-sources { margin-top: 1.25rem; padding: .85rem 1rem; background: var(--blue-tint); border-left: 4px solid var(--action); border-radius: 6px; }
.tbu .tbu-sources p { font-size: .88rem; color: var(--ink); }
.tbu .tbu-sources p + p { margin-top: .4rem; }
.tbu-sources ul { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .88rem; }
.tbu-sources li + li { margin-top: .2rem; }
.tbu-sources a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.tbu .tbu-edited { display: inline-block; margin-left: .35rem; padding: .05rem .5rem; font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--warning-soft); border: 1.5px solid var(--warning); border-radius: 999px; }

.tbu .tbu-table-note { margin-top: .5rem; font-size: .82rem; color: var(--ink-soft); }
.tbu .tbu-combo .tbu-combo-caveat { margin-top: .25rem; font-size: .78rem; color: var(--ink-soft); }
.tbu .tbu-reported { margin-top: .75rem; }
.tbu .tbu-reported p { font-size: .85rem; }
.tbu-custom { display: grid; gap: .6rem; margin: .75rem 0; }
.tbu-custom:empty { display: none; }
.tbu fieldset.tbu-custom-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: .5rem .75rem; min-width: 0; margin: 0; padding: .55rem .7rem .7rem; border: 1.5px dashed var(--border-soft); border-radius: 8px; }
.tbu .tbu-custom-row legend { padding: 0 .3rem; font-size: .8rem; font-weight: 700; }
@media (max-width: 480px) { .tbu fieldset.tbu-custom-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tbu .tbu-custom-row button { grid-column: 1 / -1; justify-self: start; } }

/* Space the page holds for this view until it mounts (see .tool-view-placeholder in _workspace.css).
   Each height is a little under the space the view takes at that width, measured as how far the
   content below moves when the view replaces the placeholder, so nothing below it moves. Re-measure
   after changing the view's layout: node scripts/measure-tool-views.js --apply twitch-bits-to-usd. */
.tool-view-placeholder[data-tool="twitch-bits-to-usd"] { min-height: 3310px; }
@media (max-width: 1144px) { .tool-view-placeholder[data-tool="twitch-bits-to-usd"] { min-height: 3433px; } }
@media (max-width: 480px) { .tool-view-placeholder[data-tool="twitch-bits-to-usd"] { min-height: 4270px; } }
