:root {
  --ink: #33392f;
  --ink-soft: #6b7160;
  --cream: #faf6ef;
  --cream-deep: #f1ead9;
  --sage: #6f7d55;
  --sage-dark: #4d5a38;
  --gold: #b08d57;
  --blush: #e9d9ce;
  --white: #ffffff;
  --danger: #b3543f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(51, 57, 47, 0.12);
  --font-display: 'Playfair Display', serif;
  --font-body: 'Jost', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 12px; line-height: 1.6; color: var(--ink-soft); }
a { color: var(--sage-dark); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--cream-deep);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--sage-dark); text-decoration: none; }
.topbar .brand small { display: block; font-family: var(--font-body); font-size: 10px; letter-spacing: 2px; color: var(--gold); text-transform: uppercase; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--sage-dark); color: var(--white); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(77, 90, 56, .35); }
.btn-outline { background: transparent; color: var(--sage-dark); border: 1.5px solid var(--sage-dark); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: 12px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--cream-deep);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--cream);
  color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); }
.field small { color: var(--ink-soft); font-size: 12px; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.pill-draft { background: #eee; color: #777; }
.pill-pending { background: #fdf0d5; color: #a5690f; }
.pill-published { background: #e1efd9; color: #3d6b2c; }
.pill-expired { background: #f3e0dd; color: var(--danger); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* phone frame: the PNG mockup (1314x2661, transparent 1170x2532 screen at 72,64) laid over the preview,
   always at its own aspect ratio so the preview matches a real phone. Content fills the whole screen,
   behind the notch. */
.phone-wrap { display: flex; justify-content: center; padding: 4px 16px 40px; }
.phone-frame {
  position: relative;
  /* fits the viewport height, but never below 300px wide (short windows scroll a little instead) */
  width: min(400px, calc(100vw - 32px), max(300px, calc((100svh - 130px) * 1314 / 2661)));
  aspect-ratio: 1314 / 2661;
  container-type: inline-size;
}
.phone-mockup { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; user-select: none; }
.phone-screen {
  --screen-h: 100%;
  position: absolute;
  z-index: 1;
  left: calc(72 / 1314 * 100%); top: calc(64 / 2661 * 100%);
  width: calc(1170 / 1314 * 100%); height: calc(2532 / 2661 * 100%);
  border-radius: calc(150 / 1314 * 100cqw);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
}
/* slim grey thumb only, no white track; the mockup PNG sits on top of it */
.phone-screen::-webkit-scrollbar { width: 4px; }
.phone-screen::-webkit-scrollbar-track { background: transparent; }
.phone-screen::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .3); border-radius: 4px; }
.phone-screen::-webkit-scrollbar-button { display: none; }
@supports not selector(::-webkit-scrollbar) {
  .phone-screen { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .3) transparent; }
}

@media (max-width: 480px) {
  .topbar { padding: 12px 16px; }
}
