:root {
  --bg: #f6efe8;
  --bg-soft: #fbf8f4;
  --paper: rgba(255, 252, 248, 0.88);
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(121, 78, 54, 0.12);
  --text: #3c2a22;
  --muted: #7a6257;
  --primary: #9f2f2f;
  --primary-dark: #7c2020;
  --gold: #d7a14a;
  --green: #2f7d62;
  --blue: #3a6ea5;
  --danger: #b84343;
  --shadow: 0 20px 40px rgba(115, 72, 48, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(215, 161, 74, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(159, 47, 47, 0.18), transparent 26%),
    linear-gradient(180deg, #fbf6f1 0%, #f3e7dc 100%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  padding: 20px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:active {
  transform: scale(0.98);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(159, 47, 47, 0.4);
  box-shadow: 0 0 0 4px rgba(159, 47, 47, 0.12);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

body.viewer-mode {
  padding: 0;
  overflow: hidden;
}

body.viewer-mode .hero-card,
body.viewer-mode .lower-grid {
  display: none;
}

body.viewer-mode .app-shell {
  max-width: none;
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  gap: 0;
}

body.viewer-mode .ledger-panel {
  min-height: 100vh;
  border-radius: 0;
  padding: 72px 18px 10px;
  box-shadow: none;
}

.viewer-back-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 5;
}

body.viewer-mode .ledger-header {
  margin-bottom: 14px;
}

body.viewer-mode .ledger-cards {
  grid-template-columns: repeat(12, minmax(96px, 1fr));
  min-height: calc(100vh - 120px);
  padding-bottom: 0;
}

body.viewer-mode .ledger-card {
  min-height: calc(100vh - 150px);
}

.hero-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--paper);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(159, 47, 47, 0.92), rgba(122, 47, 37, 0.88)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 30%);
  color: #fffaf5;
}

.hero-card::after,
.panel::after {
  content: "";
  position: absolute;
  inset: auto -40px -80px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.eyebrow,
.panel-tag {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.82;
}

.hero-card h1,
.panel h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
}

.hero-card h1 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero-desc {
  margin: 14px 0 0;
  max-width: 760px;
  line-height: 1.7;
  color: rgba(255, 250, 245, 0.88);
}

.hero-actions,
.header-actions,
.handwriting-actions,
.textarea-actions,
.compact-actions,
.ledger-card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.mini-btn {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 600;
}

.primary-btn {
  background: linear-gradient(135deg, #f4c56c, #d7993d);
  color: #532f07;
  box-shadow: 0 10px 25px rgba(215, 161, 74, 0.28);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #fffaf5;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ghost-btn {
  background: rgba(159, 47, 47, 0.08);
  color: var(--primary-dark);
}

.danger-btn {
  background: rgba(184, 67, 67, 0.14);
  color: var(--danger);
}

.mini-btn {
  min-height: 46px;
  background: rgba(159, 47, 47, 0.08);
  color: var(--primary-dark);
  padding: 0 14px;
  white-space: nowrap;
}

.large-btn {
  min-height: 60px;
  font-size: 1.05rem;
}

.small-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.lower-grid {
  align-items: start;
}

.sidebar-stack {
  display: grid;
  gap: 20px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 1.5rem;
}

.compact-ledger-header {
  align-items: center;
}

.gift-form,
.form-grid,
.field {
  display: grid;
  gap: 14px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field span {
  font-weight: 600;
  color: var(--muted);
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.segmented-control label {
  position: relative;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.segmented-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  color: var(--muted);
}

.segmented-control input:checked + span {
  background: linear-gradient(135deg, rgba(159, 47, 47, 0.9), rgba(126, 43, 34, 0.95));
  color: #fff7f0;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(159, 47, 47, 0.24);
}

.textarea-wrap {
  display: grid;
  gap: 10px;
}

.form-mode-hint {
  margin: 10px 0 0;
  color: var(--primary-dark);
  font-size: 0.95rem;
  line-height: 1.6;
}

.handwriting-panel,
.photo-import-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(159, 47, 47, 0.28);
  background: rgba(255, 248, 242, 0.85);
}

.handwriting-head,
.photo-import-head,
.photo-import-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.handwriting-head p,
.hint-text,
.photo-import-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.photo-import-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.photo-preview {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(159, 47, 47, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 237, 230, 0.92));
}

.photo-preview:not([src]) {
  display: none;
}

.photo-import-result {
  display: grid;
  gap: 10px;
}

.photo-import-text {
  margin: 0;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(159, 47, 47, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

#handwritingCanvas {
  width: 100%;
  height: 280px;
  border-radius: 18px;
  background:
    linear-gradient(transparent 95%, rgba(159, 47, 47, 0.08) 96%),
    linear-gradient(90deg, transparent 95%, rgba(159, 47, 47, 0.05) 96%),
    #fff;
  background-size: 100% 40px, 40px 100%, auto;
  border: 1px solid rgba(159, 47, 47, 0.14);
  touch-action: none;
}

.hidden {
  display: none;
}

.form-actions {
  margin-top: 8px;
}

.top-ledger-panel {
  background:
    linear-gradient(180deg, rgba(255, 248, 243, 0.98), rgba(251, 241, 233, 0.95));
}

.ledger-panel {
  padding-bottom: 16px;
}

.household-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(260px, 380px);
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}

.household-field {
  display: grid;
  gap: 10px;
}

.household-field span {
  color: var(--primary-dark);
}

.household-create-input {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ledger-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.ledger-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-indicator {
  min-width: 96px;
  text-align: center;
  font-weight: 700;
  color: var(--primary-dark);
}

.compact-search-toolbar {
  flex: 0 0 300px;
  width: 300px;
  max-width: 32%;
  justify-content: flex-end;
}

.ledger-toolbar {
  display: flex;
  justify-content: flex-end;
}

.ledger-cards {
  display: grid;
  grid-template-columns: repeat(12, minmax(88px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 8px 2px 6px;
}

.ledger-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 590px;
  min-width: 88px;
  padding: 12px 6px 12px;
  border-radius: 18px;
  border: 1.5px solid rgba(214, 113, 113, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 247, 245, 0.98), rgba(255, 241, 238, 0.96));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.ledger-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(211, 117, 117, 0.28);
  pointer-events: none;
}

.ledger-card-placeholder {
  opacity: 1;
}

.ledger-card-placeholder .placeholder-text {
  opacity: 0;
}

.ledger-card-head {
  display: grid;
  gap: 8px;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.ledger-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  background: rgba(159, 47, 47, 0.12);
  color: var(--primary-dark);
}

.ledger-writing-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr 1.25fr;
  gap: 12px;
  min-height: 470px;
}

.writing-row {
  border-radius: 16px;
  border: 1px solid rgba(214, 113, 113, 0.34);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 6px;
  display: grid;
}

.name-row {
  min-height: 180px;
}

.amount-row {
  min-height: 250px;
}

.writing-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.writing-cell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(214, 113, 113, 0.18);
  transform: translateX(-50%);
}

.amount-cell {
  flex-direction: column;
  gap: 12px;
}

.slip-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  font-family: "Noto Serif SC", serif;
  color: #2d2019;
  position: relative;
  z-index: 1;
}

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  line-height: 1.32;
  letter-spacing: 0.12em;
  font-size: 1.42rem;
  font-weight: 700;
}

.name-row .slip-value {
  min-height: 144px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}

.name-row .slip-value span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(176, 78, 78, 0.26);
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.96), rgba(252, 237, 233, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(176, 78, 78, 0.08);
}

.name-row .slip-value.name-two-chars {
  padding-block: 0.75rem;
}

.amount-upper {
  font-size: 1.42rem;
  color: #5f1f1f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.amount-number {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #8a5a11;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(184, 145, 64, 0.2);
  background: linear-gradient(180deg, rgba(255, 251, 241, 0.96), rgba(252, 242, 219, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.payment-tag {
  margin-top: 2px;
  width: 2rem;
  height: 2rem;
  font-size: 1.05rem;
  color: var(--primary-dark);
  border-radius: 999px;
  border: 1px solid rgba(159, 47, 47, 0.26);
  background: linear-gradient(180deg, rgba(255, 247, 247, 0.98), rgba(251, 229, 229, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 4px 10px rgba(159, 47, 47, 0.08);
}

.compact-number {
  margin-top: 0;
}

.placeholder-text {
  color: transparent;
}

.ledger-card-actions {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
  color: #fff;
  display: grid;
  gap: 8px;
}

.stat-card span {
  opacity: 0.86;
}

.stat-card strong {
  font-size: 1.8rem;
}

.accent-red { background: linear-gradient(135deg, #a33131, #7e2323); }
.accent-gold { background: linear-gradient(135deg, #d9a247, #b67f2c); }
.accent-green { background: linear-gradient(135deg, #2f8c69, #21664b); }
.accent-blue { background: linear-gradient(135deg, #4679b2, #2d537e); }

.feature-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.capability-notice {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 248, 232, 0.9);
  color: #8f5b17;
  line-height: 1.6;
  min-height: 56px;
}

@media (max-width: 1180px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .panel-header,
  .handwriting-head {
    flex-direction: column;
    align-items: stretch;
  }

  .household-toolbar {
    grid-template-columns: 1fr;
  }

  .compact-search-toolbar {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
  }

  .ledger-cards {
    grid-template-columns: repeat(8, minmax(88px, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    padding: 12px;
  }

  .panel,
  .hero-card {
    padding: 18px;
    border-radius: 20px;
  }

  .two-columns,
  .stats-grid,
  .segmented-control,
  .household-toolbar {
    grid-template-columns: 1fr;
  }

  .input-with-action,
  .household-create-input {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .textarea-actions,
  .handwriting-actions,
  .photo-import-actions,
  .compact-actions,
  .ledger-card-actions {
    flex-direction: column;
  }

  .photo-import-body {
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn,
  .mini-btn {
    width: 100%;
  }

  .ledger-cards {
    grid-template-columns: repeat(6, minmax(78px, 1fr));
  }

  .ledger-card {
    min-height: 540px;
    min-width: 78px;
  }

  .vertical-text {
    font-size: 0.98rem;
  }
}

@media print {
  body {
    padding: 0;
    background: #fff;
  }

  .hero-card,
  .input-panel,
  .helper-panel,
  .sidebar-stack,
  .ledger-card-actions,
  .compact-search-toolbar,
  .household-toolbar {
    display: none !important;
  }

  .app-shell,
  .ledger-panel {
    max-width: none;
    margin: 0;
    box-shadow: none;
  }

  .panel {
    border: none;
    background: #fff;
    box-shadow: none;
    padding: 0;
  }

  .ledger-cards {
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    overflow: visible;
  }

  .ledger-card {
    break-inside: avoid;
    min-height: 520px;
    box-shadow: none;
  }
}

/* ===================== 扫码登记 二维码弹窗 ===================== */

body.modal-open {
  overflow: hidden;
}

.guest-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.guest-qr-modal.hidden {
  display: none;
}

.guest-qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 22, 16, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.guest-qr-dialog {
  position: relative;
  width: min(100%, 720px);
  max-height: 92vh;
  overflow: auto;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 24px 56px rgba(40, 22, 16, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.guest-qr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.guest-qr-head h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 1.4rem;
  color: var(--primary-dark);
}

.guest-qr-body {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.guest-qr-canvas-wrap {
  width: 256px;
  min-height: 256px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(159, 47, 47, 0.18);
  box-shadow: 0 10px 24px rgba(115, 72, 48, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guest-qr-canvas-wrap img,
.guest-qr-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.guest-qr-placeholder {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 12px;
}

.guest-qr-placeholder.error {
  color: var(--danger);
}

.guest-qr-info {
  display: grid;
  gap: 14px;
  color: var(--text);
  line-height: 1.7;
}

.guest-qr-info p {
  margin: 0;
  color: var(--muted);
}

.guest-qr-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.guest-qr-url-row input {
  padding: 12px 14px;
  font-size: 0.9rem;
}

.guest-qr-stats {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(159, 47, 47, 0.08);
  color: var(--primary-dark);
}

.guest-qr-stats strong {
  margin-left: 4px;
  color: #5f1f1f;
}

.guest-qr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-qr-section {
  border-top: 1px dashed rgba(159, 47, 47, 0.25);
  padding-top: 18px;
  display: grid;
  gap: 14px;
}

.payment-qr-head h3 {
  margin: 4px 0 6px;
  font-family: "Noto Serif SC", serif;
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.payment-qr-body {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.payment-qr-preview {
  width: 200px;
  height: 200px;
  border-radius: 18px;
  background: #fff;
  border: 1px dashed rgba(159, 47, 47, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.payment-qr-preview.empty {
  background: rgba(255, 247, 240, 0.85);
}

.payment-qr-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.payment-qr-placeholder {
  color: var(--muted);
  font-size: 0.92rem;
}

.payment-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 720px) {
  .guest-qr-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .guest-qr-canvas-wrap {
    width: min(100%, 260px);
  }

  .guest-qr-info {
    width: 100%;
  }

  .payment-qr-body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* ===================== 常用礼金快捷按钮 ===================== */

.amount-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.amount-preset-btn {
  flex: 1 1 auto;
  min-width: 70px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(159, 47, 47, 0.08);
  color: var(--primary-dark);
  font-weight: 700;
  border: 1px solid rgba(159, 47, 47, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.amount-preset-btn:hover {
  background: rgba(159, 47, 47, 0.14);
}

.amount-preset-btn.active {
  background: linear-gradient(135deg, rgba(159, 47, 47, 0.95), rgba(122, 47, 37, 0.95));
  color: #fff7f0;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(159, 47, 47, 0.22);
}

.amount-preset-btn:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .amount-preset-btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
  }
}
