:root {
  color-scheme: light;
  --pink-50: #fff7fa;
  --pink-100: #ffeef4;
  --pink-200: #ffdde9;
  --pink-300: #ffc6db;
  --pink-400: #ff9fc3;
  --pink-500: #f57fae;
  --pink-600: #e26192;
  --plum: #7a3b56;
  --ink: #4a2a38;
  --muted: #9b7889;
  --white: #ffffff;
  --danger: #d9536f;
  --radius: 22px;
  --shadow: 0 12px 30px rgba(233, 138, 176, 0.18);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0 16px calc(40px + env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #ffe3ee 0%, rgba(255, 227, 238, 0) 60%),
    radial-gradient(900px 400px at 110% 5%, #ffeaf3 0%, rgba(255, 234, 243, 0) 55%),
    linear-gradient(180deg, var(--pink-50) 0%, #fffdfe 45%, var(--pink-100) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.blossom {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.blossom--one {
  width: 220px;
  height: 220px;
  top: -60px;
  right: -70px;
  background: var(--pink-300);
}

.blossom--two {
  width: 260px;
  height: 260px;
  bottom: -120px;
  left: -110px;
  background: #ffd9ec;
}

.header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 4px 18px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  box-shadow: var(--shadow);
  flex: none;
}

.header__text h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.2px;
  text-wrap: balance;
}

.header__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid var(--pink-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.intro p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--plum);
}

.counter {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.counter b {
  color: var(--pink-600);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: appear 0.25s ease;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.row__badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--pink-600);
  background: var(--pink-100);
  border-radius: 999px;
  padding: 6px 12px;
}

.row.is-saved .row__badge::after {
  content: " · сохранён";
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.icon-button {
  border: none;
  background: var(--pink-100);
  color: var(--plum);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-button:active {
  transform: scale(0.94);
}

.icon-button--danger {
  background: #ffe6ec;
  color: var(--danger);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 4px;
}

.field__input {
  width: 100%;
  border: 1px solid var(--pink-200);
  background: var(--white);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 4px rgba(255, 159, 195, 0.22);
}

.field__input::placeholder {
  color: #d3b4c2;
}

.segmented {
  display: flex;
  gap: 6px;
  background: var(--pink-100);
  border-radius: 14px;
  padding: 4px;
}

.segmented__item {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 11px;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--plum);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.segmented__item.is-active {
  background: var(--white);
  color: var(--pink-600);
  box-shadow: 0 4px 12px rgba(226, 97, 146, 0.16);
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 8px;
}

.price-grid.is-hidden {
  display: none;
}

.recipient {
  display: flex;
  gap: 8px;
  align-items: center;
}

.recipient .field__input {
  flex: 1;
}

.chip {
  border: 1px solid var(--pink-300);
  background: var(--pink-100);
  color: var(--pink-600);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.chip:active {
  transform: scale(0.96);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--plum);
  line-height: 1.4;
}

.checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--pink-500);
  margin: 0;
  flex: none;
}

.row__error {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
  min-height: 0;
}

.row__error:empty {
  display: none;
}

.save-button {
  border: none;
  border-radius: 16px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  box-shadow: 0 10px 22px rgba(226, 97, 146, 0.28);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.save-button:active {
  transform: translateY(1px) scale(0.99);
}

.save-button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px dashed var(--pink-300);
  background: rgba(255, 255, 255, 0.6);
  color: var(--pink-600);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.add-button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.add-button__plus {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: var(--white);
  font-size: 18px;
  line-height: 1;
}

.hint {
  margin: 2px 4px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 26px 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--plum);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  max-width: calc(100vw - 40px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: var(--danger);
}
