/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(var(--safe-top) + 10px) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 24, 32, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.12);
}
.title { display: flex; align-items: center; gap: 10px; }
.title h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin: 0; }
.logo-dot {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2a2f3d, #14171f);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--card-border);
}

.undo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  border: 0.5px solid var(--hair);
  padding: 8px 12px; border-radius: 999px;
  transition: transform .12s ease, background .2s ease, color .2s ease, opacity .2s ease;
}
.undo-btn:active { transform: scale(0.94); background: rgba(255,255,255,0.10); }
.undo-btn:disabled { opacity: 0.30; }
.undo-btn:not(:disabled) { color: var(--accent); border-color: rgba(229,152,155,0.25); }

/* ---------- View ---------- */
.view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4) var(--sp-4) calc(var(--tab-h) + var(--safe-bottom) + var(--sp-6));
  animation: fade .28s ease;
}

/* ---------- Pull to refresh ---------- */
.ptr {
  position: fixed;
  top: calc(var(--safe-top) + var(--tab-h) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
  z-index: 25;
  pointer-events: none;
  transition: transform .15s ease;
  opacity: 0;
}
.ptr.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.ptr-spinner {
  width: 18px;
  height: 18px;
}
.ptr-spinner.spinning {
  animation: ptr-spin .8s linear infinite;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: var(--sp-1) var(--sp-1) var(--sp-3);
}
.section-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.section-head .sub { color: var(--text-faint); font-size: 13px; font-weight: 500; }

/* ---------- Empty ---------- */
.empty {
  margin: 64px 24px;
  text-align: center;
  color: var(--text-faint);
}
.empty .ico { opacity: 0.35; margin-bottom: 12px; display: inline-flex; }
.empty p { margin: 4px 0; font-size: 15px; }
.empty .hint { font-size: 13px; color: var(--text-faint); }

/* ---------- Person card ---------- */
.cards { display: flex; flex-direction: column; gap: var(--sp-3); }
.person {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  transition: transform .18s ease;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.person-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  z-index: 1;
}
.head-info { flex: 1; min-width: 0; }
.person-name { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.person-sub { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.person-sub .pill { display: inline-flex; gap: 4px; align-items: center; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.eligible-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  color: var(--cash);
  background: rgba(255,205,178,0.12);
  border: 0.5px solid rgba(255,205,178,0.3);
  padding: 3px 8px 3px 6px; border-radius: 999px;
  white-space: nowrap;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,205,178,0.35);} 50% { box-shadow: 0 0 0 6px rgba(255,205,178,0);} }
.cashout-btn {
  border: 0; border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px; font-weight: 700;
  background: linear-gradient(160deg, #ffcdb2, #ffb4a2);
  color: #1a1820;
  display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 4px 12px rgba(255,205,178,0.3);
  transition: transform .14s ease, opacity .2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.cashout-btn:active { transform: scale(0.94); }
.cashout-btn.hidden { display: none; }

/* Hero — sandwich: − [number] + */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: var(--sp-2) var(--sp-4) var(--sp-3);
  gap: 10px;
}
.hero .pill-btn {
  height: 56px;
  border-radius: 18px;
  font-size: 30px;
}
.net-num {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.net-num.net-pos { color: var(--pos); }
.net-num.net-neg { color: var(--neg); }

/* Footer — pos/neg breakdown */
.footer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 0 var(--sp-4) var(--sp-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}
.footer .pos-count { color: var(--pos); font-size: 14px; }
.footer .neg-count { color: var(--neg); font-size: 14px; }
.footer .sep { color: var(--text-faint); opacity: 0.5; }

.pill-btn {
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.pill-btn:active { transform: scale(0.92); }
.pill-btn.up {
  background: linear-gradient(160deg, rgba(255,205,178,0.95), rgba(255,180,162,0.95));
  color: #1a1820;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 4px 16px rgba(255,180,162,0.30);
}
.pill-btn.down {
  background: rgba(181,131,141,0.18);
  color: var(--neg);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 3px 10px rgba(0,0,0,0.18);
}

.heart-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--heart-soft);
  border: 1px solid rgba(255, 107, 138, 0.3);
  border-radius: 12px;
  padding: 1px var(--sp-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--heart);
  margin-left: 6px;
}

.card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 var(--sp-4);
}

.heart-zone {
  display: flex;
  justify-content: center;
  padding: var(--sp-4);
}

.heart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: linear-gradient(135deg, var(--heart), #e84d6e);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 107, 138, 0.3);
  transition: transform .12s ease;
  flex-shrink: 0;
}
.heart-btn:active { transform: scale(0.94); }
.heart-btn .heart-icon { font-size: 20px; }

/* In heart-zone (admin card body): full-width with max-width */
.heart-zone .heart-btn { width: 100%; max-width: 220px; }

/* In person-head (non-admin header): compact inline */
.person-head .heart-btn { padding: var(--sp-2) var(--sp-4); font-size: 14px; }

/* number pop animation */
.pop { animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0.4; } 60% { transform: scale(1.18);} 100% { transform: scale(1);} }

.bump { animation: bump .22s ease; }
@keyframes bump { 0% { transform: scale(1);} 50% { transform: scale(0.85);} 100% { transform: scale(1);} }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: var(--safe-bottom);
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 380px;
  height: var(--tab-h);
  padding: 8px;
  display: flex; gap: 4px;
  z-index: 40;

  background: rgba(255, 255, 255, 0.12);
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 32px;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.18);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.tab {
  flex: 1;
  position: relative;
  z-index: 1;
  background: transparent; border: 0; border-radius: 28px;
  color: rgba(255, 255, 255, 0.65);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 600; line-height: 1;
  padding: 4px 16px;
  transition: color .2s ease, transform .14s ease;
  cursor: pointer;
}
.tab:active { transform: scale(0.92); }
.tab.active { color: #1a1820; }
.tab svg { width: 24px; height: 24px; flex-shrink: 0; transition: color .2s ease, transform .2s ease; }
.tab.active svg { color: #1a1820; transform: translateY(-1px) scale(1.05); transition: color 0s, transform .2s ease; }

.tab-pill {
  position: absolute;
  z-index: 0;
  background: rgba(255,255,255,0.82);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  transition: left .3s cubic-bezier(.2,1.4,.4,1),
              width .3s cubic-bezier(.2,1.4,.4,1),
              transform .12s cubic-bezier(.2,1.4,.4,1);
  pointer-events: none;
  top: 8px;
  height: calc(var(--tab-h) - 16px);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--tab-h) + var(--safe-bottom) + 18px);
  left: 50%; transform: translate(-50%, 16px);
  background: rgba(255, 255, 255, 0.12);
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  color: var(--text);
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.9,.3,1);
  z-index: 200; backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Modal ---------- */
#modalRoot { position: fixed; inset: 0; z-index: 100; display: none; }
#modalRoot.show { display: block; }
.modal-back {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .2s ease;
}
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(100% - 48px); max-width: 380px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  padding: 22px 20px 16px;
  animation: rise .3s cubic-bezier(.2,.9,.3,1);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
@keyframes rise { from { transform: translate(-50%, -42%); opacity: 0;} to { transform: translate(-50%,-50%); opacity: 1;} }
.modal h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.modal p { margin: 0 0 14px; color: var(--text-dim); font-size: 14px; line-height: 1.45; }
.modal .actions { display: flex; gap: 10px; }
.modal .actions .btn { flex: 1; padding: 12px; }
.modal input { margin-bottom: 18px; }

/* Reassign modal */
.reassign-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 320px; overflow-y: auto; }
.reassign-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 8px 8px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
}
.reassign-source { font-size: 14px; font-weight: 600; color: var(--text); padding: 4px 0; }
.reassign-arrow { font-size: 14px; color: var(--text-faint); }
.reassign-select {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  background: var(--bg-3); color: var(--text);
  border: 0.5px solid var(--hair); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; font-weight: 500;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 10px) center, calc(100% - 6px) center;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  padding-right: 24px;
  cursor: pointer;
}

/* Undo modal */
.undo-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; max-height: 320px; overflow-y: auto; }
.undo-action {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 12px;
  border-bottom: 0.5px solid var(--hair);
}
.undo-action:last-child { border-bottom: 0; }
.undo-action.latest { background: rgba(255,255,255,0.03); }
.undo-action .h-dot { width: 26px; height: 26px; font-size: 11px; }
.undo-action .h-main .top { font-size: 13px; }
.undo-action .h-main .bot { font-size: 11px; }
.undo-action-btn {
  border: 0; border-radius: 999px;
  padding: 6px 14px; font-size: 12px; font-weight: 700;
  background: var(--accent); color: #1a1408;
  cursor: pointer; transition: transform .12s ease;
}
.undo-action-btn:active { transform: scale(0.94); }

/* ---------- Heart modal ---------- */
.heart-modal-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.heart-modal-recipient { display: flex; align-items: center; gap: 10px; }
.heart-modal-recipient .avatar { width: 40px; height: 40px; font-size: 15px; }
.heart-modal-recipient .name { font-size: 16px; font-weight: 600; }
.heart-stepper { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); }
.heart-stepper-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 0.5px solid var(--hair);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 20px; font-weight: 600;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}
.heart-stepper-btn:active { transform: scale(0.88); background: rgba(255,255,255,0.12); }
.heart-count { color: var(--heart); font-weight: 600; display: inline-flex; align-items: center; }
.heart-stepper .heart-count { font-size: 28px; font-weight: 800; min-width: 24px; text-align: center; color: inherit; }
.heart-sym { margin-left: 2px; }
.heart-symbol { font-size: 22px; color: var(--heart); }
.heart-note {
  width: 100%; resize: none;
  background: var(--bg-3); color: var(--text);
  border: 0.5px solid var(--hair); border-radius: 12px;
  padding: 11px 14px; font-size: 14px;
  outline: none; font-family: inherit;
  min-height: 80px;
}
.heart-note:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.heart-photo { display: flex; flex-direction: column; gap: var(--sp-2); }
.heart-attach-btn {
  width: 100%;
  padding: var(--sp-3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background .2s ease;
}
.heart-attach-btn:active { background: rgba(255, 255, 255, 0.10); }
.heart-photo-preview { position: relative; display: inline-flex; }
.heart-photo-preview img {
  width: 80px; height: 80px; border-radius: 12px;
  object-fit: cover; border: 0.5px solid var(--hair);
}
.heart-photo-remove {
  position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 11px; display: grid; place-items: center;
  cursor: pointer;
}

/* ---------- Heart visual display ---------- */
.heart-modal .heart-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.75;
  min-height: 180px;
  border-radius: 20px;
  background: radial-gradient(ellipse at center, rgba(255,107,138,0.12) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 4px 0 8px;
}

.heart-modal .heart-bg-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,138,0.25) 0%, transparent 65%);
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.4s ease;
  pointer-events: none;
}

.heart-modal .heart {
  position: absolute;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  transition: transform 0.35s cubic-bezier(.2,1.4,.4,1),
              opacity 0.25s ease,
              width 0.3s ease,
              height 0.3s ease;
  will-change: transform;
}

.heart-modal .heart svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 6px rgba(255,107,138,0.35));
  transition: filter 0.2s ease;
}

.heart-modal .heart:active svg {
  filter: drop-shadow(0 4px 12px rgba(255,107,138,0.55));
}

.heart-modal .heart.main-heart {
  width: 72px;
  height: 72px;
  z-index: 2;
}

.heart-modal .heart.additional {
  width: 54px;
  height: 54px;
  z-index: 1;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(0);
}

.heart-modal .heart.additional.pop-in,
.heart-modal .heart.main-heart.pop-in {
  animation: heartPop 0.45s cubic-bezier(.2,1.4,.4,1) forwards;
}

.heart-modal .heart.additional.pop-out {
  animation: heartPopOut 0.25s cubic-bezier(.4,0,.6,1) forwards;
}

@keyframes heartPop {
  0%   { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(0); opacity: 0; }
  50%  { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(1.25); opacity: 1; }
  75%  { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(0.92); }
  100% { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(1); opacity: 1; }
}

@keyframes heartPopOut {
  0%   { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(calc(var(--rot, 0) * 1deg)) scale(0); opacity: 0; }
}

/* Idle wiggle for main heart */
.heart-modal .heart.main-heart svg {
  animation: heartWiggle 3s ease-in-out infinite;
}

@keyframes heartWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* ---------- Chunky slider ---------- */
.heart-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
}

.heart-slider-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  min-width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.heart-slider-wrap .slider-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--heart);
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.heart-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  border-radius: 14px;
  background: transparent;
  outline: none;
  cursor: pointer;
}

.heart-slider::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--heart) var(--fill, 10%), rgba(255,255,255,0.08) var(--fill, 10%));
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.heart-slider::-moz-range-track {
  height: 14px;
  border-radius: 7px;
  background: rgba(255,255,255,0.08);
  border: 0;
}

.heart-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff, #ffe0e8);
  border: 2px solid var(--heart);
  box-shadow: 0 2px 8px rgba(255,107,138,0.35), inset 0 1px 2px rgba(255,255,255,0.8);
  margin-top: -9px;
  cursor: grab;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.heart-slider::-webkit-slider-thumb:active {
  transform: scale(1.12);
  box-shadow: 0 3px 12px rgba(255,107,138,0.5), inset 0 1px 2px rgba(255,255,255,0.9);
  cursor: grabbing;
}

.heart-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff, #ffe0e8);
  border: 2px solid var(--heart);
  box-shadow: 0 2px 8px rgba(255,107,138,0.35), inset 0 1px 2px rgba(255,255,255,0.8);
  cursor: grab;
}

/* ---------- Buttons / Inputs ---------- */
.input {
  width: 100%; background: var(--bg-3); color: var(--text);
  border: 0.5px solid var(--hair); border-radius: 12px;
  padding: 11px 14px; font-size: 15px; outline: none;
  margin: 4px 16px 14px; width: calc(100% - 32px);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  border: 0.5px solid var(--hair); background: rgba(255,255,255,0.05);
  color: var(--text); padding: 11px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #1a1408; border-color: transparent; }
.btn.danger { background: var(--neg-soft); color: var(--neg); border-color: rgba(255,69,58,0.25); }
.btn-row { display: flex; gap: 10px; padding: 0 16px 16px; }
.btn-row .btn { flex: 1; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(255,255,255,0.05); border: 0.5px solid var(--hair);
  display: grid; place-items: center; color: var(--text-dim);
  transition: all .14s ease; cursor: pointer;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger { color: var(--neg); }

.history-list { display: flex; flex-direction: column; }
.h-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3);
  padding: 11px 2px; border-bottom: 0.5px solid var(--hair);
}
.h-item:last-child { border-bottom: 0; }
.h-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.h-dot.pos { background: var(--pos-soft); color: var(--pos); }
.h-dot.neg { background: var(--neg-soft); color: var(--neg); }
.h-dot.cash { background: rgba(255,205,178,0.16); color: var(--cash); }
.h-dot.undo { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.h-dot.heart { background: var(--heart-soft); color: var(--heart); }
.h-amt.heart { color: var(--heart); }
.h-main { min-width: 0; }
.h-main .top { font-size: 14px; font-weight: 600; }
.h-main .bot { font-size: 12px; color: var(--text-faint); }
.h-amt { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.h-amt.pos { color: var(--pos); }
.h-amt.neg { color: var(--neg); }
.h-amt.cash { color: var(--cash); }

/* small screens safety */
@media (max-width: 360px) {
  .counter .number { font-size: 26px; min-width: 38px; }
  .btn-step { width: 38px; height: 38px; }
}
