:root {
  --ink: #1c1917;
  --muted: #57534e;
  --paper: #faf7f2;
  --panel: rgba(255, 252, 247, 0.88);
  --line: rgba(28, 25, 23, 0.12);
  --accent: #0f5c4c;
  --accent-2: #c45c26;
  --shadow: 0 18px 50px rgba(28, 25, 23, 0.08);
  --radius: 18px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100vh;
}

.bg-wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(15, 92, 76, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(196, 92, 38, 0.12), transparent 50%),
    linear-gradient(180deg, #f3ebe1 0%, #faf7f2 40%, #f6f1ea 100%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 6vw;
}
.site-footer { justify-content: center; color: var(--muted); font-size: 0.92rem; padding-bottom: 2.5rem; }
.brand, .brand-hero {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand { font-size: 1.45rem; color: var(--ink); text-decoration: none; }
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-lg { padding: 0.85rem 1.45rem; font-size: 1.02rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.hero {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-items: center;
  padding: 4vh 6vw 8vh;
}
.hero-copy { max-width: 42rem; animation: rise 0.9s ease both; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--muted); margin: 0 0 0.75rem; }
.brand-hero {
  font-size: clamp(3.2rem, 9vw, 6.2rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  animation: rise 1s 0.08s ease both;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0 1rem; }
.price-note { color: var(--muted); font-size: 0.95rem; }
.price-note strong { color: var(--ink); }

.section { padding: 4rem 6vw; max-width: 960px; }
.section h2, .panel h1, .panel h2, .dash-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.section-lede, .muted { color: var(--muted); }
.feature-list, .steps { padding-left: 1.2rem; }
.feature-list li, .steps li { margin: 0.55rem 0; }

.flash { margin: 1rem 6vw; padding: 0.85rem 1rem; border-radius: 12px; }
.flash-success { background: #e7f5ef; color: #0f5c4c; }
.flash-error { background: #fdece8; color: #9b2c1f; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: #14241f;
  color: #f5f1ea;
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar .brand { color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 0.55rem; }
.sidebar a { color: rgba(255,255,255,0.82); text-decoration: none; padding: 0.45rem 0.55rem; border-radius: 10px; }
.sidebar a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.app-main { padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.panel, .callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.dash-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: #ece7df; font-size: 0.85rem; }
.pill.ok, .status-published { background: #d8f0e5; color: #0f5c4c; }
.status-draft, .status-preview_ready { background: #f4e6d8; color: #8a4b1f; }

.builder-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.builder-steps a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255,255,255,0.55);
}
.builder-steps a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.92rem; margin-bottom: 0.85rem; }
input, textarea, select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
.form-grid .full, label.full { grid-column: 1 / -1; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 1rem 0; }
.slug-field { display: flex; align-items: center; gap: 0.35rem; }
.slug-field span { color: var(--muted); white-space: nowrap; font-size: 0.85rem; }
.slug-field input { flex: 1; }

.media-grid, .template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.media-card, .template-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 0;
}
.media-card img, .media-card video, .template-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-card figcaption { display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 0.55rem; font-size: 0.85rem; }
.template-card { padding: 0.75rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.35rem; }
.template-card.selected, .template-card:has(input:checked) { outline: 2px solid var(--accent); }
.template-card input { position: absolute; opacity: 0; }
.template-card span { color: var(--muted); font-size: 0.85rem; }
.track-list { display: grid; gap: 0.5rem; margin: 1rem 0; }
.track-option { flex-direction: row; align-items: center; gap: 0.6rem; }
.check-grid { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.45rem; }
.check-grid label { flex-direction: row; align-items: center; gap: 0.5rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.35rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.plain-list { padding-left: 1.1rem; }
.mt { margin-top: 1.25rem; }
.cal-embed iframe { width: 100%; min-height: 700px; border: 0; border-radius: var(--radius); background: #fff; }
.errors { color: #9b2c1f; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .site-header { flex-direction: column; align-items: flex-start; }
}

/* Google sign-in */
.login-page {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
  padding: 2rem 6vw;
}
.login-card {
  width: min(480px, 100%);
  animation: rise 0.7s ease both;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin: 0 0 0.5rem;
}
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin: 1.25rem 0 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #1f1f1f;
  font: inherit;
  font-weight: 500;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-google:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(28,25,23,0.08);
}
.btn-google-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.login-note { font-size: 0.88rem; }
.setup-steps { padding-left: 1.2rem; margin: 0.75rem 0 0; }
.setup-steps li { margin: 0.55rem 0; }
.code-block {
  display: block;
  margin-top: 0.4rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: #1c1917;
  color: #f5f1ea;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
}

.check-inline { flex-direction: row !important; align-items: center; gap: 0.5rem; }
.builder-steps { overflow-x: auto; }

/* Template picker */
.template-pick-panel { max-width: 960px; }
.template-pick-header { margin-bottom: 0.25rem; }
.template-pick-header h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.template-pick-header .muted { margin: 0.35rem 0 0; max-width: 36rem; }

.template-pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.35rem;
  align-items: stretch;
}
@media (min-width: 640px) {
  .template-pick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.template-pick-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.template-pick-card:hover {
  border-color: rgba(15, 92, 76, 0.35);
  box-shadow: 0 14px 34px rgba(28, 25, 23, 0.1);
}
.template-pick-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 92, 76, 0.2), 0 14px 34px rgba(28, 25, 23, 0.08);
}

.template-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.template-pick-preview {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f0ebe4;
  overflow: hidden;
  line-height: 0;
}
.template-pick-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 0.75rem;
  box-sizing: border-box;
}

.template-pick-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1.05rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.template-pick-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.template-pick-title strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}
.template-pick-desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  display: block;
}
.template-pick-title .pill {
  margin: 0;
  flex-shrink: 0;
  font-style: normal;
  font-size: 0.75rem;
}
.template-pick-actions { margin-top: 1.35rem; }

.builder-edit h2 { margin-top: 1.5rem; }
.builder-edit h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0.75rem 0 0.35rem;
}
.admin-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.admin-template-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.admin-template-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  display: block;
  background: #f0ebe4;
  padding: 0.75rem;
  box-sizing: border-box;
}
.admin-template-card .meta { padding: 0.65rem 0.85rem 0; }
.admin-template-card .actions { padding: 0.5rem 0.85rem 0.85rem; }

