/* ── Cards: pastel stickers applied by hand ───────────────── */
.card {
  position: relative;
  padding: var(--pad);
  background: var(--sand);
  border: var(--outline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, 0deg));
}

.card > * {
  position: relative;
  z-index: 1;
}

.card--blush {
  --tilt: -0.9deg;
  background: var(--blush);
}

.card--butter {
  --tilt: 0.7deg;
  background: var(--butter);
}

.card--mint {
  --tilt: -0.5deg;
  background: var(--mint);
}

.card--lilac {
  --tilt: 0.6deg;
  background: var(--lilac);
}

.card--sage {
  --tilt: -0.4deg;
  background: var(--sage);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px 5px;
  background: var(--card);
  border: var(--outline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-display);
  font-weight: var(--weight-mid);
  font-size: var(--text-note);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sub {
  margin-top: 6px;
  font-size: var(--text-note);
  color: var(--ink-2);
}

.hint {
  margin-top: 10px;
  font-size: var(--text-note);
  color: var(--ink-2);
  line-height: 1.4;
}

.hint a {
  color: var(--price);
}

/* ── Press: the sticker goes down and its shadow shrinks ──── */
.pressable {
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.pressable:active:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow: var(--shadow-press);
}

/* ── Mode choices: two fat pills ──────────────────────────── */
.modes {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}

@media (min-width: 520px) {
  .modes {
    grid-template-columns: 1fr 1fr;
  }
}

.mode {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 74px;
  padding: 12px 34px 12px 18px;
  background: var(--card);
  border: var(--outline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.mode:hover {
  transform: translateY(-1px) rotate(-0.4deg);
  box-shadow: var(--shadow-sm);
}

.mode:active {
  transform: translate(2px, 3px);
  box-shadow: var(--shadow-press);
}

.mode input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.mode__title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-body);
  line-height: 1.15;
}

.mode__note {
  font-size: var(--text-note);
  color: var(--ink-2);
}

.mode__star {
  position: absolute;
  top: -9px;
  right: -6px;
  width: 26px;
  height: 26px;
  color: var(--ink);
  background: var(--butter);
  border: var(--outline);
  border-radius: 50%;
  display: none;
  padding: 3px;
  transform: rotate(8deg);
}

.mode:has(input:checked) {
  background: var(--mint);
  border: var(--outline-thick);
  box-shadow: var(--shadow-sm);
}

.mode:has(input:checked) .mode__note {
  color: var(--ink-2);
}

.mode:has(input:checked) .mode__star {
  display: block;
}

.mode:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* ── Rows: cream pills on a pastel card ───────────────────── */
.rows {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  background: var(--card);
  border: var(--outline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.row--toggle {
  cursor: pointer;
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce);
}

.row--toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.row > span:first-child {
  min-width: 0;
}

.row__label {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--weight-mid);
  font-size: var(--text-body);
  line-height: 1.2;
}

.row__sub {
  display: block;
  margin-top: 2px;
  font-size: var(--text-note);
  color: var(--ink-2);
  line-height: 1.3;
}

.row__amount {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-note);
  color: var(--price);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Cartoon toggle ───────────────────────────────────────── */
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 32px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch__track {
  display: block;
  position: relative;
  width: 54px;
  height: 32px;
  background: var(--sand);
  border: var(--outline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-xs) inset;
  transition: background-color 0.15s;
}

.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: var(--card);
  border: var(--outline);
  border-radius: 50%;
  transition: transform 0.2s var(--bounce), background-color 0.15s;
}

.switch input:checked + .switch__track {
  background: var(--mint);
}

.switch input:checked + .switch__track .switch__knob {
  transform: translateX(22px);
}

.switch input:focus-visible + .switch__track {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* ── Page stickers ────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 15px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--weight-mid);
  font-size: var(--text-note);
  border: var(--outline);
  border-style: dashed;
  border-radius: var(--pill);
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.chip:hover {
  background: var(--card);
  border-style: solid;
  transform: translateY(-1px) rotate(-1deg);
  box-shadow: var(--shadow-xs);
}

.chip:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.chip[aria-pressed="true"] {
  background: var(--card);
  border-style: solid;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.chip[aria-pressed="true"]:hover {
  background: var(--blush);
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.list:empty {
  margin-top: 0;
}

.list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 4px 6px 4px 16px;
  background: var(--card);
  border: var(--outline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-xs);
  animation: sticker-in 0.26s var(--bounce) both;
}

@keyframes sticker-in {
  from {
    opacity: 0;
    transform: translateY(-5px) rotate(-2deg) scale(0.96);
  }
}

/* a pastel per sticker, on rotation, so the board looks hand-stuck */
.list__item:nth-child(5n + 1) {
  background: var(--butter);
}

.list__item:nth-child(5n + 2) {
  background: var(--lilac);
}

.list__item:nth-child(5n + 3) {
  background: var(--blush);
}

.list__item:nth-child(5n + 4) {
  background: var(--sage);
}

.list__item:nth-child(5n + 5) {
  background: var(--paper-2);
}

.list__item:nth-child(odd) {
  transform: rotate(-0.5deg);
}

.list__item:nth-child(even) {
  transform: rotate(0.5deg);
}

.list__name {
  font-family: var(--font-display);
  font-weight: var(--weight-mid);
  font-size: var(--text-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.list__amount {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-note);
  color: var(--price);
  font-variant-numeric: tabular-nums;
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--card);
  border: var(--outline);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.iconbtn:hover {
  background: var(--blush);
  transform: rotate(-6deg);
}

.iconbtn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.iconbtn svg {
  width: 13px;
  height: 13px;
}

/* ── Label maker ──────────────────────────────────────────── */
.adder {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.adder input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  background: var(--card);
  border: var(--outline);
  border-radius: var(--pill);
  font-family: var(--font-body);
  font-size: var(--text-body);
}

.adder input::placeholder {
  color: var(--ink-2);
  opacity: 1;
}

.adder input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.adder__btn {
  flex: 0 0 auto;
  width: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--butter);
  border: var(--outline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.adder__btn:hover:not(:disabled) {
  background: var(--mint);
}

.adder__btn:active:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow: var(--shadow-press);
}

.adder__btn:disabled {
  background: var(--sand);
  color: var(--ink-2);
  box-shadow: none;
  cursor: not-allowed;
}

.adder__btn svg {
  width: 16px;
  height: 16px;
}

/* ── Stepper ──────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hit);
  height: var(--hit);
  background: var(--card);
  border: var(--outline);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.step:hover:not(:disabled) {
  background: var(--blush);
}

.step:active:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow: var(--shadow-press);
}

.step--plus {
  background: var(--mint);
}

.step--plus:hover:not(:disabled) {
  background: var(--sage);
}

.step:disabled {
  background: var(--sand);
  color: var(--ink-2);
  box-shadow: none;
  cursor: not-allowed;
}

.step svg {
  width: 15px;
  height: 15px;
}

.step__value {
  min-width: 58px;
  padding: 5px 0 6px;
  text-align: center;
  background: var(--card);
  border: var(--outline);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stepper__amount {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-body);
  color: var(--price);
  font-variant-numeric: tabular-nums;
}

/* ── The receipt ──────────────────────────────────────────── */
.receipt {
  position: relative;
  padding: 28px 18px 24px;
  background: var(--card);
  border-left: var(--outline);
  border-right: var(--outline);
  border-top: 0;
  border-bottom: 0;
  box-shadow: 5px 6px 0 -2px var(--ink);
  transform: rotate(var(--tilt, 1deg));
}

/* Torn top and bottom edges: a filled sawtooth with an ink outline,
   drawn as real SVG so the outline follows the tear. */
.torn {
  position: absolute;
  left: -2px;
  width: calc(100% + 4px);
  height: 9px;
  overflow: visible;
  color: var(--card);
}

.torn--top {
  top: -8px;
}

.torn--bottom {
  bottom: -8px;
}

.receipt__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.receipt__title::before,
.receipt__title::after {
  content: "";
  flex: 0 0 18px;
  border-bottom: 2px dotted var(--line-soft);
}

.lines {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
}

.lines__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  animation: line-in 0.24s var(--bounce) both;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
}

.lines__label {
  color: var(--ink);
}

.lines__dots {
  flex: 1 1 auto;
  min-width: 12px;
  border-bottom: 2px dotted var(--line-soft);
  transform: translateY(-3px);
}

.lines__amount {
  color: var(--price);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quote__empty {
  margin-top: 12px;
  font-size: var(--text-note);
  color: var(--ink-2);
}

.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px -18px 0;
  padding: 12px 18px 14px;
  background: var(--ink);
  color: var(--card);
}

.total__label {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-note);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.total__amount {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(22px, 6.4vw, 32px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s var(--bounce);
}

.total__amount.is-bumped {
  transform: scale(1.06) rotate(-0.6deg);
}

.total__note {
  margin: 10px 0 0;
  font-size: var(--text-note);
  color: var(--ink-2);
  text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-body);
  border: var(--outline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce), background-color 0.15s;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.btn--wa {
  margin-top: 16px;
  background: var(--mint);
  color: var(--ink);
}

.btn--wa:hover {
  background: var(--sage);
}

.btn--copy {
  margin-top: 9px;
  min-height: 48px;
  background: var(--card);
  color: var(--ink);
}

.btn--copy:hover {
  background: var(--butter);
}

.btn--copy.is-done {
  background: var(--butter);
}

.btn:active {
  transform: translate(2px, 3px);
  box-shadow: var(--shadow-press);
}

.quote__foot {
  margin-top: 12px;
  font-size: var(--text-note);
  color: var(--ink-2);
  text-align: center;
}

.quote__foot a {
  color: var(--price);
}

/* ── Sticky strip button ──────────────────────────────────── */
.stickybar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--hit);
  padding: 0 16px;
  background: var(--mint);
  border: var(--outline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-note);
  transition: transform 0.12s var(--bounce), box-shadow 0.12s var(--bounce);
}

.stickybar__btn:active {
  transform: translate(2px, 3px);
  box-shadow: var(--shadow-press);
}

/* ── Little decorations ───────────────────────────────────── */
.squiggle {
  color: var(--mint);
}

.spark {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: super;
  color: var(--price);
}

@media (max-width: 979px) {
  .receipt {
    --tilt: 0.7deg;
  }

  .card {
    --tilt: 0deg;
  }

  .card--blush {
    --tilt: -0.6deg;
  }

  .card--butter {
    --tilt: 0.5deg;
  }
}
