:root {
  --ink: #24332d;
  --muted: #6b7771;
  --green: #326753;
  --green-dark: #244d3e;
  --green-pale: #edf3ef;
  --rose: #bd6d76;
  --cream: #f7f2e9;
  --paper: #fffdf9;
  --line: #e7ded1;
  --danger: #a64343;
  --success: #2e6d50;
  --shadow: 0 18px 48px rgba(49, 67, 58, .11);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(189,109,118,.12), transparent 32%),
    radial-gradient(circle at 0 100%, rgba(50,103,83,.07), transparent 32%),
    var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
}
.bridge-frame {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 0 0 20px;
  padding: 0 2px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,253,249,.86);
  color: var(--green);
  font-size: 22px;
}
.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .12em;
}
.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 48px;
  margin-bottom: 20px;
}
.topbar-title {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .13em;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  background: rgba(255,253,249,.86);
  font-size: 22px;
}

.hero, .card {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 44px 30px 31px;
  border-radius: 31px;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 80px;
  border-radius: 50%;
  background: rgba(189,109,118,.10);
}
.hero::before { top: -43px; right: -35px; }
.hero::after { right: -35px; bottom: -50px; }
.eyebrow {
  margin: 0 0 19px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .17em;
}
.hero h1, .screen-title {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 600;
  letter-spacing: .01em;
}
.hero h1 { font-size: clamp(39px, 11vw, 58px); line-height: 1.25; }
.hero-copy {
  margin: 26px 0 29px;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}
.button-stack { display: grid; gap: 12px; }
.primary-button, .secondary-button, .danger-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 900;
}
.primary-button {
  border: 0;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 25px rgba(50,103,83,.21);
}
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { opacity: .5; cursor: wait; box-shadow: none; }
.secondary-button {
  border: 1px solid #cfddd5;
  color: var(--green);
  background: var(--green-pale);
}
.danger-button {
  min-height: 50px;
  border: 1px solid rgba(166,67,67,.25);
  color: var(--danger);
  background: transparent;
}
.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.feature {
  min-height: 116px;
  padding: 17px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
  background: rgba(255,253,249,.78);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 9px;
  border-radius: 50%;
  color: var(--green);
  background: #eef5f1;
  font-size: 18px;
}
.feature strong { display: block; font-size: 12px; }
.feature span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.footer-note { margin: 24px 12px 0; text-align: center; color: #8a928d; font-size: 10px; line-height: 1.8; }

.screen-intro { margin: 28px 5px 20px; }
.screen-label { margin: 0 0 9px; color: var(--rose); font-size: 11px; font-weight: 900; letter-spacing: .17em; }
.screen-title { font-size: 30px; line-height: 1.45; }
.screen-copy { margin: 11px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.card { padding: 23px 20px; border-radius: 24px; }
.card + .card { margin-top: 15px; }

.field + .field { margin-top: 21px; }
label, .field-label { display: block; margin: 0 0 9px; font-size: 13px; font-weight: 850; }
.required { margin-left: 6px; color: var(--rose); font-size: 10px; vertical-align: 1px; }
input, select {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid #d9d2c7;
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(50,103,83,.1); }
.help { margin: 8px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.status {
  display: none;
  margin: 15px 0 0;
  padding: 12px 13px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.65;
}
.status.show { display: block; }
.status.info { color: #53625b; background: #f0f3f1; }
.status.error { color: var(--danger); background: #fbeeee; }
.status.success { color: var(--success); background: #eaf4ee; }

.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--green);
  background: #eef5f1;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}
.profile-meta { min-width: 0; }
.profile-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.profile-meta span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.next-card {
  padding: 24px;
  border: 0;
  border-radius: 25px;
  color: white;
  background: var(--green);
  box-shadow: 0 17px 38px rgba(50,103,83,.24);
}
.next-kicker { margin: 0 0 13px; color: rgba(255,255,255,.75); font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.next-card h2 { margin: 0; font-family: "Yu Mincho", serif; font-size: 26px; font-weight: 600; }
.next-date { margin: 10px 0 0; font-size: 13px; }
.next-remaining { margin: 21px 0 0; font-size: 30px; font-weight: 900; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 25px 3px 12px; }
.section-head h2 { margin: 0; font-size: 15px; }
.anniversary-list { display: grid; gap: 11px; }
.anniversary-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  color: var(--ink);
  background: rgba(255,253,249,.92);
}
.anniversary-date {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: var(--green);
  background: #eef5f1;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}
.anniversary-info { min-width: 0; }
.anniversary-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.anniversary-info span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.chevron { color: #9ca6a0; font-size: 20px; }
.empty-state { padding: 31px 20px; border: 1px dashed #d9d1c5; border-radius: 20px; text-align: center; color: var(--muted); background: rgba(255,253,249,.6); }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 14px; }
.empty-state span { font-size: 11px; line-height: 1.7; }

.loading {
  display: grid;
  place-items: center;
  min-height: 70vh;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 39px;
  height: 39px;
  margin: 0 auto 16px;
  border: 3px solid rgba(50,103,83,.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.admin-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #e9f2ed;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

@media (max-width: 420px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .hero { padding: 37px 25px 27px; }
  .feature { min-height: 110px; padding-left: 5px; padding-right: 5px; }
  .feature strong { font-size: 11px; }
}
