:root {
  --bg: #f7e4ec;
  --ink: #5c3044;
  --muted: #8d6574;
  --rose: #e7b4c2;
  --rose-deep: #d9899d;
  --blush: #f8e3ea;
  --card: #fffdfd;
  --line: #f3d4de;
  --nav: #c9a8b3;
  --shadow: 0 10px 24px rgba(176, 104, 128, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: Nunito, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.35;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 3px;
}

#toast {
  position: fixed;
  z-index: 5;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

#toast[hidden] { display: none; }

.wrap {
  max-width: 430px;
  margin: 0 auto;
  padding: calc(6px + env(safe-area-inset-top)) 18px 28px;
}

body.has-nav .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

h1 {
  margin: 4px 0 14px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 600;
}

.devnote {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.hero { position: relative; padding-top: 8px; text-align: center; }

.spark { width: 74px; height: 34px; margin: 0 auto; color: var(--rose-deep); }
.spark svg { width: 74px; height: 34px; }

.count {
  margin: 0;
  font-size: 62px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.count-caption {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.portrait {
  position: relative;
  height: 142px;
  margin-top: 2px;
}

.ribbon {
  position: absolute;
  left: -18px;
  right: -18px;
  top: 46px;
  color: #e08aa3;
  width: calc(100% + 36px);
  height: 78px;
}
.ribbon svg { width: 100%; height: 100%; display: block; }

.avatar {
  position: absolute;
  left: 50%;
  top: 16px;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  margin-left: -54px;
  padding: 0;
  border: 4px solid white;
  border-radius: 50%;
  background: #f6d5e0 center/cover no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar .placeholder { width: 40px; height: 40px; color: #d9899d; }
.avatar .placeholder svg { width: 100%; height: 100%; }

.avatar-heart {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 28px;
  height: 28px;
  margin-left: 34px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: #f7b7c6;
  color: white;
}

.avatar-heart svg { width: 14px; height: 14px; }

.quote {
  position: relative;
  width: 100%;
  margin: 2px 0 10px;
  padding: 14px 46px;
  border: 1px solid #f3d0dc;
  border-radius: 22px;
  background: #fff7f9;
  color: #7d4b5e;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.quote .pen {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  color: #c98b9c;
}

.quote-form, .card, .panel {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 84px;
  padding: 10px 8px 8px;
  border: 1px solid #f6e4ea;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
  text-align: left;
}

.tile .glyph { width: 26px; height: 26px; color: #e3a8b6; }
.tile .glyph svg, .ico svg { width: 100%; height: 100%; }

.tile .label {
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}
.tile .label > span:first-child { flex: 1; }

.tile .chev, .chev { width: 14px; height: 14px; color: #e7b7c4; flex: none; }

.event-card, .wish-card {
  width: 100%;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow);
  text-align: left;
}

.card-head, .wish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-head { margin-bottom: 10px; font-size: 13px; font-weight: 800; color: #9a6d7c; }
.card-head span, .wish-copy { display: flex; align-items: center; gap: 8px; }
.ico { width: 18px; height: 18px; color: #e3a8b6; }

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8e1e8;
  color: #c47d90;
  font-size: 12px;
  font-weight: 800;
}

.event-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: #fff7f9;
}

.gift {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f8e3ea;
  color: #e09aab;
}

.gift svg { width: 22px; height: 22px; }
.event-inner strong, .wish-copy strong { display: block; font-size: 16px; }
.event-inner small, .wish-copy small { color: var(--muted); font-weight: 700; }

.open-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1.5px solid #f0c6d1;
  border-radius: 999px;
  background: white;
  color: #c98b9c;
  font-size: 13px;
  font-weight: 800;
}

.stack { display: flex; flex-direction: column; gap: 10px; }
.primary, .ghost {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 800;
}
.primary { border: none; background: var(--ink); color: white; }
.ghost { border: 1.5px solid var(--rose); background: white; color: var(--ink); }
.texty {
  min-height: 44px;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--rose-deep);
  font-weight: 800;
}

.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.field span { font-size: 14px; font-weight: 800; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
textarea { min-height: 88px; resize: vertical; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 12px;
  font-weight: 700;
}
.check input { width: 18px; height: 18px; accent-color: var(--rose-deep); }

.item {
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.item h2 { margin: 0 0 4px; font-size: 18px; }
.meta { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.note { margin: 8px 0 0; white-space: pre-wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.actions button {
  min-height: 40px;
  padding: 6px 0;
  border: none;
  background: none;
  font-weight: 800;
}
.actions button.quiet { color: var(--muted); }
.done { margin: 8px 0 0; color: #c46d86; font-size: 14px; font-weight: 800; }
.alert { margin: 0 0 10px; color: #b85b74; font-weight: 800; }
.linkline { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; word-break: break-all; }

.photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: white;
}
.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.shot .actions { padding: 0 10px 6px; }
.cover-flag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: white;
  font-size: 11px;
  font-weight: 800;
}

.stats { display: grid; gap: 8px; }
.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 800;
}
.stat span { color: var(--muted); font-weight: 700; }

nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid #f3d5df;
  background: rgba(255, 248, 250, 0.94);
  backdrop-filter: blur(10px);
}
nav[hidden] { display: none; }
nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--nav);
  font-size: 11px;
  font-weight: 800;
}
nav button svg { width: 22px; height: 22px; }
nav button[aria-current="page"] { color: var(--ink); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
