* { box-sizing: border-box }
:root { color-scheme: dark; font-family: system-ui, sans-serif; color: #fff0ef; background: #bf86a0 }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 50% 52%, var(--glow) 0%, var(--middle) 48%, var(--night) 100%) }
button, input, select { font: inherit }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .58 }
:focus-visible { outline: 2px solid #ffd391; outline-offset: 4px }
main { width: min(100%, 520px); min-height: 100dvh; margin: auto; padding: max(20px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column }
header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f8bdd72d; padding-bottom: 15px }
#banks-menu { font-family: Georgia, serif; font-size: 24px; letter-spacing: -.035em; padding-left: 0 }
.header-actions { display: flex; align-items: center; gap: 8px }
.round { width: 46px; height: 46px; border-radius: 100%; border: 1px solid #f8bdd750; background: #f8bdd715; color: #f9d0df; font-size: 28px; line-height: 1 }
.bank { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 25px 0 }
#bank-name { max-width: 100%; overflow-wrap: anywhere; text-align: center; margin: 0; font: normal clamp(30px, 9.4vw, 52px) Georgia, serif; letter-spacing: -.045em }
.quiet { background: none; border: none; color: #f2c4d6; min-height: 44px; padding: 7px 12px; font-size: .875rem }
main { --stage-width: min(100%, 49dvh) }
.stage { width: var(--stage-width); margin: -4px 0 1px }
canvas { width: 100%; display: block }
.progress { font-size: .95rem; color: #f7d5df; font-variant-numeric: tabular-nums; text-align: center }
.track { width: min(155px, 68%); height: 4px; background: #f4bbd337; border-radius: 8px; margin-top: 13px; overflow: hidden }
#fill { background: #ffc96e; width: 0; height: 100%; transition: width .24s }
.deposit { background: linear-gradient(115deg, #ffe1a6, #f7b875); color: #3e2231; border: 0; border-radius: 18px; min-height: 54px; padding: 12px 20px; font-weight: 700 }
footer { display: flex; justify-content: center }
/* The pig and its tail occupy about 89% of the canvas. */
footer .deposit { width: calc(var(--stage-width) * .89); box-shadow: 0 8px 30px #1a0d2099 }
.deposit span { margin-right: 6px }
dialog { color: inherit; width: min(420px, calc(100% - 36px)); background: var(--panel); border: 1px solid #f8bdd750; border-radius: 24px; padding: 24px }
dialog::backdrop { background: #160918b8 }
h2 { margin: 0 0 20px; font-family: Georgia, serif; font-weight: normal }
label { display: block; margin-bottom: 8px }
#name, #capacity { width: 100%; color: inherit; background: var(--night); border: 1px solid #f8bdd750; border-radius: 12px; padding: 12px }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px }
@media (prefers-reduced-motion: reduce) { #fill { transition: none } }
.completed { color: #f0bacd; margin-top: 12px; font-size: .875rem }
.results-scroll { max-height: 52dvh; overflow: auto }
#totals-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums }
#totals-table th, #totals-table td { padding: 10px 4px; border-bottom: 1px solid #f8bdd735; text-align: right }
#totals-table th:first-child { text-align: left; overflow-wrap: anywhere }
#totals-table thead { color: #f2c4d6; font-size: .875rem }
#totals-table tbody th { font-weight: 500 }
#totals-table td { color: #ffd391 }
[hidden] { display: none !important }
#delete-name { overflow-wrap: anywhere }
.danger { min-height: 48px; padding: 10px 18px; border: 1px solid #f8bdd750; border-radius: 14px; color: #fff3f4; background: #843d55; font-weight: 700 }

[data-theme="rose"] { --middle: #dca8bd; --night: #bf86a0; --pig: #DF8EAF }
body { --glow: #f9dce8; --middle: #dca8bd; --night: #bf86a0; --panel: #59364c }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) main { color: #43253b }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) main :is(.quiet, .round, .progress, .completed),
#bank-list li:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) :is(.quiet, .bank-choice) { color: #43253b }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) header { border-color: #43253b40 }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) .round { border-color: #43253b60; background: #fff0f530 }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) .track { background: #43253b40 }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) main :focus-visible,
#bank-list li:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) :focus-visible { outline-color: #652b52 }
body:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) :is(#name, #capacity) { background: #40263a }
#bank-list li:is([data-theme="rose"], [data-theme="caramel"], [data-theme="sage"], [data-theme="lavender"], [data-theme="taupe"]) .bank-choice[aria-current="true"] { background: #fff0f560 }
[data-theme="blue"] { --glow: #4a6183; --middle: #334661; --night: #222d42; --panel: #3a4c67; --pig: #829BB8 }
[data-theme="olive"] { --glow: #635a2c; --middle: #463e24; --night: #292619; --panel: #4c4429; --pig: #897B30 }
[data-theme="terra"] { --glow: #86402d; --middle: #592e25; --night: #321e1c; --panel: #62362c; --pig: #A1452D }
[data-theme="caramel"] { --glow: #FAE4CD; --middle: #E2B992; --night: #C89B75; --panel: #624936; --pig: #DCAD7D }
[data-theme="sage"] { --glow: #EBF1E0; --middle: #C6D1B7; --night: #A6B69A; --panel: #46543E; --pig: #AEBE98 }
[data-theme="lavender"] { --glow: #F1E5FA; --middle: #D7C6E7; --night: #BAA7CE; --panel: #554263; --pig: #C3AED9 }
[data-theme="taupe"] { --glow: #F0E8E3; --middle: #D4C5BB; --night: #B7A49B; --panel: #55443C; --pig: #C5B0A0 }
.themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; padding: 0; margin: 16px 0 0; min-width: 0 }
.themes legend { padding: 0; margin-bottom: 8px }
.theme-option { display: flex; align-items: center; gap: 7px; min-height: 46px; margin: 0; padding: 6px; border: 1px solid #ffffff40; border-radius: 10px; font-size: .875rem; cursor: pointer }
.theme-option:has(:checked) { border-color: #ffd391; background: #ffffff14 }
.theme-option input { margin: 0; accent-color: #ffd391 }
.swatch { width: 18px; height: 18px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--middle) 50%, var(--pig) 51%); border: 1px solid #ffffff63 }
@media (max-width: 370px) { .theme-option { gap: 5px; font-size: .8125rem } .swatch { width: 14px; height: 14px } }
@media (max-width: 350px) { .themes { grid-template-columns: 1fr } }

label[for="capacity"] { margin-top: 14px }

#bank-list { list-style: none; margin: 0; padding: 0; max-height: 55dvh; overflow: auto }
#bank-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px; padding: 4px; margin-bottom: 8px; border: 1px solid var(--pig); border-radius: 12px; background: linear-gradient(100deg, var(--middle), var(--night)) }
#bank-list .quiet { padding-inline: 6px }
.bank-choice { min-width: 0; min-height: 44px; text-align: left; overflow-wrap: anywhere; color: #fff0ef; background: none; border: none; border-radius: 8px; padding: 7px 8px; font-weight: 600 }
.bank-choice::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; background: var(--pig); border-radius: 50% }
.bank-choice[aria-current="true"] { background: #ffffff19 }

#editor { max-height: calc(100dvh - 32px); overflow-y: auto }
