:root {
  --lp-bg: #f6f4ef;
  --lp-surface: #ffffff;
  --lp-soft: #f1ece4;
  --lp-line: #ddd5c7;
  --lp-text: #222120;
  --lp-muted: #6a665f;
  --lp-accent: #1f1f1f;
  --lp-radius-lg: 28px;
  --lp-radius-md: 18px;
  --lp-shadow: 0 16px 40px rgba(41, 36, 31, 0.08);
  --lp-max: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: var(--lp-text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 24%),
    linear-gradient(180deg, var(--lp-bg) 0%, #efeae2 100%);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
}

.lp-shell {
  width: min(calc(100% - 28px), var(--lp-max));
  margin: 0 auto;
}

.lp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}

.lp-brand {
  font-size: 1.15rem;
  font-weight: 700;
}

.lp-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.lp-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.lp-hero,
.lp-section,
.lp-panel,
.lp-printable-shell,
.lp-admin-shell,
.lp-form-card,
.lp-record-card,
.lp-note,
.lp-preview-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-lg);
  box-shadow: var(--lp-shadow);
}

.lp-hero,
.lp-section,
.lp-admin-shell {
  padding: 28px;
  margin-bottom: 18px;
}

.lp-hero {
  display: grid;
  gap: 20px;
}

.lp-note {
  padding: 18px;
}

.lp-eyebrow,
.lp-pill,
.lp-badge {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lp-muted);
  font-weight: 700;
}

.lp-lead {
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  margin-top: 12px;
  max-width: 760px;
}

.lp-actions,
.lp-inline-actions,
.lp-meta-row,
.lp-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lp-actions,
.lp-record-actions {
  margin-top: 20px;
}

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--lp-accent);
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.lp-btn-primary {
  background: var(--lp-accent);
  color: #fff;
}

.lp-btn-secondary {
  border-color: var(--lp-line);
}

.lp-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.lp-search,
.lp-input,
.lp-select,
.lp-textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--lp-text);
  font: inherit;
}

.lp-textarea {
  min-height: 110px;
  resize: vertical;
}

.lp-grid,
.lp-admin-grid,
.lp-record-list,
.lp-stats {
  display: grid;
  gap: 14px;
}

.lp-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.lp-card {
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-md);
  padding: 18px;
  background: var(--lp-surface);
}

.lp-card img,
.lp-hero-art img,
.lp-printable-canvas img,
.lp-preview-art img {
  border-radius: 18px;
  border: 1px solid var(--lp-line);
}

.lp-card h3 {
  margin: 10px 0 8px;
  font-size: 1.25rem;
}

.lp-card p {
  color: var(--lp-muted);
}

.lp-card .lp-inline-actions {
  margin-top: 14px;
}

.lp-path {
  font-size: 0.9rem;
  color: var(--lp-muted);
  word-break: break-word;
}

.lp-page-wrap {
  width: min(calc(100% - 28px), 1200px);
  margin: 0 auto;
  padding: 18px 0 48px;
}

.lp-page-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.lp-printable-shell {
  padding: 24px;
}

.lp-printable-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--lp-line);
}

.lp-printable-head p {
  color: var(--lp-muted);
  margin-top: 8px;
}

.lp-printable-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lp-pill {
  border: 1px solid var(--lp-line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #faf9f6;
  letter-spacing: 0.08em;
}

.lp-printable-body {
  padding-top: 18px;
}

.lp-printable-canvas {
  position: relative;
  width: min(100%, 920px);
  margin: 0 auto;
}

.lp-design-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 1536;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--lp-line);
  background: #fff;
}

.lp-design-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lp-field-layer {
  position: absolute;
  inset: 0;
}

.lp-field {
  position: absolute;
  margin: 0;
}

.lp-field input[type="text"],
.lp-field textarea {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: #2e2a25;
  font-size: clamp(12px, 1.25vw, 18px);
  padding: 0 2px;
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  resize: none;
}

.lp-field input[type="text"]:focus,
.lp-field textarea:focus {
  outline: 1px dashed rgba(31, 31, 31, 0.28);
  outline-offset: 1px;
}

.lp-checkbox-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
}

.lp-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.lp-textarea textarea {
  line-height: 1.5;
}

.lp-footer-note {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--lp-muted);
  font-size: 0.92rem;
  flex-wrap: wrap;
}

.lp-save-status {
  min-height: 1.25rem;
  margin-top: 10px;
  color: var(--lp-muted);
}

.lp-bare-page {
  background: #f4f0e8;
}

.lp-bare-page:not(.lp-viewer-open) .lp-float-controls {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.lp-page-wrap-bare {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: 0 0 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.lp-printable-shell-bare {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.lp-printable-body-bare {
  padding-top: 0;
  height: 100%;
}

.lp-printable-canvas-bare {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
}

.lp-design-stage-bare {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: #f4f0e8;
  box-shadow: none;
  aspect-ratio: auto;
  cursor: zoom-in;
  position: relative;
}

.lp-design-stage-bare .lp-design-image {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.lp-open-viewer {
  position: relative;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(34, 33, 32, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--lp-text);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.lp-viewer-open .lp-design-stage-bare {
  cursor: default;
  position: fixed;
  inset: 20px 20px 20px 20px;
  z-index: 60;
  background: rgba(244, 240, 232, 0.98);
  padding: 60px 16px 16px;
}

.lp-viewer-open .lp-open-viewer {
  display: none;
}

.lp-viewer-open .lp-design-stage-bare .lp-design-image {
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 32px));
  max-height: calc(100dvh - 96px);
  object-fit: contain;
}

.lp-float-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 70;
  pointer-events: none;
}

.lp-viewer-open .lp-float-controls,
.lp-float-controls.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lp-float-btn {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(34, 33, 32, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: var(--lp-text);
  font-size: 0.72rem;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.lp-admin-shell {
  padding: 28px;
}

.lp-admin-grid {
  grid-template-columns: 1.05fr 0.95fr;
}

.lp-form-card,
.lp-preview-panel,
.lp-record-card {
  padding: 18px;
}

.lp-form-grid {
  display: grid;
  gap: 14px;
}

.lp-form-two {
  display: grid;
  gap: 14px;
}

.lp-field-group {
  display: grid;
  gap: 6px;
}

.lp-form-help,
.lp-muted {
  color: var(--lp-muted);
}

.lp-record-list {
  margin-top: 12px;
}

.lp-record-card h3 {
  margin-bottom: 6px;
}

.lp-preview-art {
  margin-top: 14px;
}

.lp-codee-note {
  margin-top: 14px;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  padding: 14px;
  background: #faf9f6;
  color: var(--lp-muted);
}

.lp-hidden {
  display: none !important;
}

@media (min-width: 860px) {
  .lp-hero {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }

  .lp-form-two {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 859px) {
  .lp-admin-grid {
    grid-template-columns: 1fr;
  }

  .lp-printable-shell,
  .lp-section,
  .lp-hero,
  .lp-admin-shell {
    padding: 20px;
  }

  .lp-float-controls {
    top: 8px;
    right: 8px;
    max-width: calc(100vw - 16px);
  }

  .lp-viewer-open .lp-design-stage-bare {
    inset: 12px;
    padding: 54px 10px 10px;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0;
  }

  html,
  body {
    background: #fff;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .lp-topbar,
  .lp-page-toolbar,
  .lp-float-controls,
  .lp-save-status,
  .lp-open-viewer {
    display: none !important;
  }

  .lp-page-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
  }

  .lp-printable-shell {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .lp-printable-head {
    padding-bottom: 0.18in;
  }

  .lp-printable-canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .lp-design-stage {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .lp-page-wrap-bare,
  .lp-printable-body-bare,
  .lp-printable-canvas-bare,
  .lp-design-stage-bare,
  .lp-viewer-open .lp-design-stage-bare {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .lp-design-stage-bare .lp-design-image {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
