/* ---------- secret editor page ---------- */
.editor-page { padding-bottom: 120px; }

.ed-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-200), var(--blue-100));
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ed-back {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.ed-back:hover { background: var(--pink-200); }

.ed-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 32px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 0;
}

/* Side menu (a scrolling chip row on phones). */
.ed-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ed-nav a, .ed-nav .soon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.ed-nav a:hover { background: rgba(248, 200, 220, 0.5); }
.ed-nav a[aria-current="true"] { background: #fff; box-shadow: var(--shadow); color: var(--rose-deep); }
.ed-nav .soon { color: var(--muted); opacity: 0.7; }
.ed-nav small {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-500);
  font-size: 0.68rem;
  font-weight: 700;
}

.ed-main { min-width: 0; }
.ed-hello h1 { margin: 0; font-size: clamp(2.6rem, 8vw, 3.4rem); color: var(--rose-deep); line-height: 1.1; }
.ed-hello p { margin: 2px 0 0; color: var(--muted); }

.ed-note {
  display: flex;
  gap: 10px;
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(90, 143, 208, 0.25);
  border-radius: 16px;
  background: rgba(228, 241, 252, 0.8);
  color: var(--navy);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ed-card {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
}
.ed-card-head h2, .ed-reset h2 { margin: 0; color: var(--navy); font-size: 1.2rem; }
.ed-card-head p, .ed-reset p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

/* Fields */
.field { display: block; margin-top: 18px; }
.field-label { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 700; font-size: 0.85rem; }
.field input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--pink-200);
  border-radius: 14px;
  background: #fffafc;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input:hover { border-color: #f3aec9; }
.field input:focus { outline: none; border-color: var(--rose); background: #fff; box-shadow: 0 0 0 4px rgba(232, 98, 143, 0.15); }
.field input[type="date"] { cursor: pointer; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-error { min-height: 0; margin: 8px 0 0; color: var(--rose-deep); font-weight: 600; font-size: 0.88rem; }
.field-error:empty { display: none; }

/* Anniversary: stats + bouquet preview */
.ed-story { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: center; }
.ed-stats { display: grid; gap: 10px; margin: 20px 0 0; }
.ed-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-soft);
}
.ed-stats div:nth-child(2) { background: var(--blue-100); }
.ed-stats dt { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.ed-stats dd { margin: 0; color: var(--navy); font-weight: 700; font-size: 0.92rem; text-align: right; }
.ed-preview { margin: 0; text-align: center; }
.ed-preview-art {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(228, 241, 252, 0.9), rgba(253, 232, 241, 0.7));
  pointer-events: none;
}
.ed-preview-art .bouquet { width: 100% !important; max-width: 200px; }
.ed-preview figcaption { margin-top: 8px; color: var(--muted); font-size: 0.8rem; }

/* Names preview */
.ed-name-preview {
  margin-top: 18px;
  padding: 18px 16px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--bg-soft), var(--blue-100));
  text-align: center;
}
.ed-name-preview .script { margin: 0; color: var(--rose-deep); font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.1; overflow-wrap: anywhere; }
.ed-name-preview p:last-child { margin: 4px 0 0; color: var(--muted); font-weight: 500; font-size: 0.9rem; }

.ed-reset { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn.danger { background: var(--rose-deep); color: #fff; border-color: var(--rose-deep); }

/* Floating save bar */
.ed-savebar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(600px, calc(100% - 32px));
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(47, 74, 128, 0.18);
  translate: -50% 0;
}
.ed-status { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.ed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--leaf); flex: none; }
.ed-status.unsaved { color: var(--rose-deep); }
.ed-status.unsaved .ed-dot { background: var(--rose); animation: pulse 1.6s ease-in-out infinite; }
.ed-savebar .btn:disabled { opacity: 0.45; cursor: default; }

/* Toast */
.ed-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  z-index: 30;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  translate: -50% -12px;
  transition: opacity 0.25s ease, translate 0.25s ease;
  max-width: calc(100% - 32px);
  text-align: center;
}
.ed-toast.show { opacity: 1; translate: -50% 0; }
.ed-toast.bad { background: var(--rose-deep); }

@media (max-width: 760px) {
  .ed-layout { grid-template-columns: 1fr; gap: 0; padding: 12px 16px 0; }
  .ed-nav {
    top: 56px;
    z-index: 5;
    flex-direction: row;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 8px 16px;
    background: rgba(255, 246, 250, 0.9);
    backdrop-filter: blur(10px);
    scrollbar-width: none;
  }
  .ed-nav::-webkit-scrollbar { display: none; }
  .ed-nav a, .ed-nav .soon { padding: 8px 12px; font-size: 0.88rem; }
  .ed-nav a[aria-current="true"] { box-shadow: 0 4px 14px rgba(196, 61, 108, 0.14); }
  .ed-hello { margin-top: 12px; }
  .ed-story { grid-template-columns: 1fr; }
  .ed-preview-art { min-height: 200px; }
  .ed-preview-art .bouquet { max-width: 170px; }
  .ed-card { padding: 20px 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .ed-badge { display: none; }
  .ed-savebar { padding-left: 14px; }
  .ed-status { font-size: 0.82rem; }
  .ed-savebar .btn { padding: 9px 14px; }
}
@media (max-width: 380px) {
  #discard { display: none; }
}

/* ---------- account + sign-in gate ---------- */
.ed-account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-who { color: var(--muted); font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.btn.wide { width: 100%; padding: 13px 20px; font-size: 1rem; }
.ed-note.ok { border-color: rgba(111, 174, 138, 0.35); background: rgba(226, 244, 233, 0.85); color: #2f5d45; }

.gate { display: grid; place-items: center; min-height: calc(100vh - 140px); padding: 32px 16px; }
.gate-card {
  width: min(400px, 100%);
  padding: 32px 26px 28px;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}
.gate-flower { margin: 0; font-size: 2.6rem; line-height: 1; }
.gate-card h1 { margin: 6px 0 0; color: var(--rose-deep); font-size: 2.8rem; line-height: 1.1; }
.gate-text { margin: 6px 0 0; color: var(--muted); }
.gate-text:empty { display: none; }
.gate-form { margin-top: 8px; text-align: left; }
.gate-form .btn { margin-top: 20px; }
.gate-form .btn:disabled { opacity: 0.6; cursor: wait; }
.gate-actions { display: grid; gap: 10px; margin-top: 20px; }
.gate-actions:empty { display: none; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 72px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--navy);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  translate: 0 -50%;
}
.pw-toggle:focus-visible { outline: 2px solid var(--navy); }

@media (max-width: 760px) {
  .ed-who { display: none; }
  .ed-account { margin-left: auto; }
}
