:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --ink: #17181b;
  --soft: rgba(23, 24, 27, 0.58);
  --line: rgba(23, 24, 27, 0.1);
  --accent: #1c8f62;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; text-align: left; }
ul { list-style: none; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.be { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(348px, 100%); padding: 16px 14px 12px; border-radius: 26px; background: var(--card); box-shadow: inset 0 0 0 1.500px var(--line), 0 30px 44px -30px rgba(23, 24, 27, 0.35); }
.be__head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 0 4px; }
.be__what { display: grid; gap: 2px; min-width: 0; }
.be__label { font-size: 12px; font-weight: 640; color: var(--soft); }
.be__clip { display: block; height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; }
.be__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }
.be__big { display: block; height: 40px; }
.be__big b { display: block; font-size: 38px; line-height: 40px; font-weight: 680; font-stretch: 86%; letter-spacing: -0.02em; transition: color 0.4s ease; }
.be.is-done .be__big b { color: var(--accent); }
.be__month { flex: none; height: 26px; padding: 0 11px; border-radius: 13px; background: rgba(23, 24, 27, 0.05); font-size: 12px; line-height: 26px; font-weight: 660; color: var(--soft); }
.be__chip { position: absolute; left: 4px; top: 24px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--accent); color: #ffffff; font-size: 12.500px; line-height: 24px; font-weight: 740; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 3; box-shadow: 0 8px 12px -8px rgba(23, 24, 27, 0.6); }

/* the envelopes: the tint behind each one is as wide as the share of its goal already inside */
.be__list { display: grid; gap: 6px; }
.be__env { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 54px; padding: 0 12px 0 13px; border-radius: 16px; background: rgba(23, 24, 27, 0.035); overflow: hidden; box-shadow: inset 0 0 0 1.500px transparent; transition: box-shadow 0.3s ease; }
.be__env.is-full { box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 50%, transparent); }
.be__env:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.be__env[disabled] { cursor: default; }
.be__fill { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 15%, transparent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
.be__ic { position: relative; flex: none; display: block; width: 28px; height: 22px; overflow: visible; }
.be__paper { fill: #ffffff; stroke: var(--ink); stroke-width: 1.600; }
.be__flap { fill: none; stroke: var(--ink); stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }
.be__env.is-full .be__paper, .be__env.is-full .be__flap { stroke: var(--accent); }
.be__name { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; flex: 1; }
.be__name strong { font-size: 14px; line-height: 18px; font-weight: 720; }
.be__name .be__clip { font-size: 12px; font-weight: 600; color: var(--soft); }
.be__more { position: relative; flex: none; height: 28px; padding: 6px 11px; border-radius: 14px; background: #ffffff; box-shadow: 0 1px 1px rgba(23, 24, 27, 0.08), 0 5px 10px -6px rgba(23, 24, 27, 0.35); transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.be__clip--more { font-size: 12px; font-weight: 700; color: var(--ink); transition: color 0.3s ease; }
.be__env.is-full .be__more { background: var(--accent); box-shadow: none; }
.be__env.is-full .be__clip--more { color: #ffffff; }
.be__env[disabled]:not(.is-full) .be__more { opacity: 0.45; }
.be__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 4px; font-size: 12px; font-weight: 620; color: var(--soft); }
.be__foot .be__clip { min-width: 0; }
.be__undo { flex: none; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 700; color: var(--ink); background: rgba(23, 24, 27, 0.06); transition: opacity 0.25s ease; }
.be__undo[disabled] { opacity: 0.35; cursor: default; }
.be__undo:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (max-width: 350px) { .be { padding: 14px 10px 10px; } .be__env { gap: 9px; padding: 0 10px; } .be__big b { font-size: 34px; } }
@media (max-height: 400px) { .be { gap: 10px; } .be__env { height: 50px; } }
@media (prefers-reduced-motion: reduce) { .be__big b, .be__env, .be__more, .be__clip--more, .be__undo { transition: none; } }
