:root {
  --olive: #6e7b4f;
  --olive-deep: #4f5a38;
  --rose: #e39a94;
  --rose-deep: #d07b74;
  --rose-soft: #f8e9e6;
  --cream: #f7f3ec;
  --ink: #3c3a32;
  --muted: #8b867b;
  --line: #e6e0d6;
  --white: #fff;
  --green: #1a4336;
  --page: #efe8dc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Nunito Sans", sans-serif;
  background: var(--page);
  color: var(--ink);
}

.app {
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(80, 60, 40, 0.08);
}

.content {
  flex: 1;
  padding: 16px 20px 96px;
  overflow-y: auto;
}
.content.nopad { padding: 0 0 96px; }
.content.nopad .pad { padding: 16px 20px 0; }

.tiny {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.serif {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: var(--olive-deep);
  line-height: 1.08;
}
.rose { color: var(--rose-deep); font-style: italic; }

.row { display: flex; align-items: center; gap: 10px; }
.space { justify-content: space-between; }

.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  height: 168px;
  margin: 10px 0 14px;
}
.hero img, .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero .veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(26, 67, 54, 0.78));
}
.hero .caption {
  position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff;
}

.cover { height: 230px; position: relative; overflow: hidden; }
.cover img { object-position: center 42%; }
.back {
  position: absolute; left: 16px; top: 14px; z-index: 2;
  background: #fff; border: 1px solid var(--rose);
  color: var(--olive-deep); text-decoration: none;
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600;
}

.card {
  background: var(--cream);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
}
.card.soft { background: var(--rose-soft); }
.card.outline { border: 1.5px solid var(--rose); }

.btn {
  display: block; width: 100%; text-align: center;
  background: var(--olive); color: #fff; border: 0;
  border-radius: 999px; padding: 13px 16px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  cursor: pointer; font-family: inherit;
}
.btn.sm { padding: 10px 16px; margin-top: 10px; }
.btn.ghost {
  background: transparent; color: var(--olive-deep);
  border: 1px solid var(--olive); margin-top: 8px;
}
.btn.rose { background: var(--rose-deep); }
.btn:disabled { opacity: 0.5; cursor: default; }

.pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--rose); color: var(--olive-deep);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; background: #fff;
  cursor: pointer; font-family: inherit;
}
.pill.on { background: var(--olive); color: #fff; border-color: var(--olive); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--olive-deep); background: var(--rose-soft);
  flex-shrink: 0; font-size: 13px;
}
.avatar.sm { width: 36px; height: 36px; font-size: 10px; background: var(--green); color: #fff; }
.avatar.lg {
  width: 108px; height: 108px; margin: 0 auto 8px;
  overflow: hidden; border: 3px solid var(--rose-soft);
}
.avatar.lg img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }

.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 10px; }

.gallery-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 14px 0 8px;
}
.gallery {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 6px; -webkit-overflow-scrolling: touch;
}
.g-item {
  position: relative; flex: 0 0 76px; height: 76px;
  border-radius: 14px; overflow: hidden; background: var(--cream);
}
.g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.g-grid .g-item { flex: none; width: 100%; height: 140px; }
.dl {
  position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
}
.dl svg { width: 12px; height: 12px; color: var(--olive-deep); }
.del-photo {
  position: absolute; left: 5px; top: 5px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; color: var(--rose-deep);
  border: 0; font-size: 16px; line-height: 1; font-weight: 700; cursor: pointer;
}
.g-add {
  flex: 0 0 76px; height: 76px; border-radius: 14px;
  border: 1.5px dashed var(--rose); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--rose-deep); font-size: 11px; font-weight: 700;
  background: var(--rose-soft); cursor: pointer; font-family: inherit;
}

.tabbar {
  position: sticky; bottom: 0;
  height: 72px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px 14px; background: var(--white);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-decoration: none;
}
.tab.on { color: var(--olive-deep); }
.tab svg { width: 22px; height: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--olive-deep); color: #fff; padding: 10px 16px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

.note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font-family: inherit; font-size: 14px; margin-top: 6px;
  background: #fff; color: var(--ink);
}
label.tiny { display: block; margin-top: 12px; }
.admin h1 { margin-bottom: 8px; }
.admin .sec { margin: 18px 0 8px; }
.field { margin-top: 10px; }
.field span { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.help { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 8px 0 12px; }
.okdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6a9a5a; margin-right: 6px; }
.baddot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rose-deep); margin-right: 6px; }
.apanes { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.apanes .pill { flex: 0 0 auto; }
.preview-clip {
  height: 420px; overflow: hidden; background: var(--cream);
  border-radius: 20px; margin-bottom: 12px;
}
.preview-phone {
  width: 390px; margin: 0 auto; transform: scale(0.72); transform-origin: top center;
  pointer-events: none; background: #fff; border: 8px solid #2a2a2a;
  border-radius: 36px; overflow: hidden; min-height: 760px;
}
.preview-phone .tabbar { position: static; }
.preview-phone a[href="#/admin"] { display: none !important; }
.pane { display: none; }
.pane.on { display: block; }
.ph-prev {
  width: 72px; height: 72px; object-fit: cover; border-radius: 12px;
  background: var(--cream); flex-shrink: 0;
}

@media (min-width: 520px) {
  body { padding: 24px 0; }
  .app {
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(80, 60, 40, 0.16);
  }
}
