:root {
  color-scheme: light;
  --ink: #182022;
  --muted: #657073;
  --line: #d8dfdc;
  --soft: #f5f7f2;
  --panel: #ffffff;
  --green: #176b52;
  --green-dark: #0d4f3b;
  --red: #b33a3a;
  --blue: #2f5f9f;
  --gold: #9a6b12;
  --shadow: 0 10px 30px rgba(24, 32, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #eef2ed;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
}

button:hover {
  border-color: #aab5b1;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ready {
  border-color: var(--blue);
  color: var(--blue);
}

.export {
  border-color: var(--green);
  color: var(--green);
}

.posted {
  border-color: var(--gold);
  color: var(--gold);
}

.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.app-shell {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0 20px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.status-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  padding: 7px 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.composer,
.review-panel {
  min-width: 0;
}

.composer {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 10px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: 2px solid rgba(23, 107, 82, 0.15);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
}

.review-panel {
  display: grid;
  gap: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.tabs,
.design-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab,
.design-tab {
  min-height: 34px;
  color: var(--muted);
}

.tab.active,
.design-tab.active {
  border-color: var(--green);
  background: #e4f0eb;
  color: var(--green-dark);
}

.message {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  padding: 12px;
}

.message.error {
  border-color: #e3b5b5;
  color: var(--red);
}

.pin-list {
  display: grid;
  gap: 12px;
}

.pin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.pin-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--muted);
}

.badge.draft {
  color: var(--gold);
}

.badge.approved {
  color: var(--green);
}

.badge.rejected {
  color: var(--red);
}

.badge.scheduled,
.badge.posted {
  color: var(--blue);
}

.pin-title {
  min-height: 42px;
  font-size: 20px;
  font-weight: 800;
}

.pin-description {
  min-height: 92px;
}

.pin-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-data {
  min-height: 170px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.pin-side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.design-preview {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 300px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid #cbd6d1;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(235, 242, 238, 0.76)),
    radial-gradient(circle at 20% 20%, rgba(23, 107, 82, 0.18), transparent 28%),
    linear-gradient(160deg, #f8faf6, #dfe8e3);
  background-position: center;
  background-size: cover;
  color: var(--ink);
  padding: 16px;
  cursor: zoom-in;
}

.preview-brand,
.preview-kicker,
.preview-cta {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.preview-brand {
  color: var(--green);
}

.preview-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  max-width: 100%;
}

.preview-copy h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.05;
}

.preview-kicker,
.preview-subheadline,
.preview-copy blockquote {
  margin: 0;
}

.preview-subheadline {
  color: #3d494b;
  font-size: 12px;
  line-height: 1.35;
}

.preview-copy blockquote {
  border-left: 3px solid var(--green);
  color: #314042;
  font-size: 12px;
  font-style: italic;
  line-height: 1.35;
  padding-left: 8px;
}

.preview-product {
  position: relative;
  z-index: 1;
  width: min(70%, 150px);
  max-height: 118px;
  justify-self: end;
  align-self: end;
  border-radius: 6px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(24, 32, 34, 0.18));
}

.preview-product.placeholder {
  display: grid;
  place-items: center;
  height: 92px;
  border: 1px dashed #9aa7a3;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  filter: none;
}

.preview-cta {
  justify-self: start;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  padding: 8px 11px;
}

.preview-quote {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(232, 238, 232, 0.78)),
    linear-gradient(135deg, #f7f8f1, #e2eadf);
}

.preview-quote .preview-product {
  opacity: 0.82;
}

.preview-product-feature {
  background:
    linear-gradient(135deg, rgba(246, 250, 248, 0.82), rgba(255, 255, 255, 0.56)),
    linear-gradient(135deg, #edf3ef, #d7e3df);
}

.preview-product-feature .preview-product {
  width: min(88%, 180px);
  max-height: 150px;
  justify-self: center;
}

.preview-checklist {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 243, 239, 0.82)),
    repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(23, 107, 82, 0.08) 31px);
}

.preview-checklist .preview-copy blockquote {
  font-style: normal;
}

.preview-benefit {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(233, 241, 237, 0.72)),
    radial-gradient(circle at 85% 78%, rgba(154, 107, 18, 0.22), transparent 26%),
    linear-gradient(145deg, #f7faf5, #dde8e2);
}

.status-select,
.design-select {
  height: 40px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-actions .save {
  grid-column: 1 / -1;
}

.card-actions .ready {
  grid-column: 1 / -1;
}

.card-actions .export {
  grid-column: 1 / -1;
}

.card-actions .posted {
  grid-column: 1 / -1;
}

.card-actions .delete {
  grid-column: 1 / -1;
}

.danger {
  color: var(--red);
}

.empty-state {
  border: 1px dashed #b8c3bf;
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.posted-meta {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  padding: 9px 10px;
}

.preview-modal {
  width: min(94vw, 760px);
  max-height: 94vh;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.preview-modal::backdrop {
  background: rgba(12, 20, 18, 0.68);
}

.modal-shell {
  display: grid;
  gap: 12px;
  justify-items: end;
  border-radius: 8px;
  background: #f6f8f5;
  padding: 14px;
}

.modal-close {
  background: #fff;
}

#modalPreviewContent {
  width: min(520px, 86vw);
  justify-self: center;
}

#modalPreviewContent .design-preview {
  min-height: auto;
  width: 100%;
  cursor: default;
  padding: 34px;
}

#modalPreviewContent .preview-brand,
#modalPreviewContent .preview-kicker,
#modalPreviewContent .preview-cta {
  font-size: 14px;
}

#modalPreviewContent .preview-copy {
  gap: 14px;
}

#modalPreviewContent .preview-copy h2 {
  font-size: 48px;
  line-height: 1;
}

#modalPreviewContent .preview-subheadline,
#modalPreviewContent .preview-copy blockquote {
  font-size: 20px;
  line-height: 1.3;
}

#modalPreviewContent .preview-product {
  width: min(78%, 320px);
  max-height: 280px;
}

#modalPreviewContent .preview-product.placeholder {
  height: 180px;
  font-size: 18px;
}

#modalPreviewContent .preview-cta {
  padding: 13px 18px;
}

.export-stage {
  position: fixed;
  left: -12000px;
  top: 0;
  width: 1000px;
  pointer-events: none;
}

.export-stage .design-preview {
  width: 1000px;
  min-height: auto;
  cursor: default;
  padding: 70px;
}

.export-stage .preview-brand,
.export-stage .preview-kicker,
.export-stage .preview-cta {
  font-size: 28px;
}

.export-stage .preview-copy {
  gap: 30px;
}

.export-stage .preview-copy h2 {
  font-size: 92px;
  line-height: 0.98;
}

.export-stage .preview-subheadline,
.export-stage .preview-copy blockquote {
  font-size: 40px;
  line-height: 1.25;
}

.export-stage .preview-copy blockquote {
  border-left-width: 8px;
  padding-left: 22px;
}

.export-stage .preview-product {
  width: min(78%, 560px);
  max-height: 500px;
}

.export-stage .preview-product.placeholder {
  height: 360px;
  font-size: 36px;
}

.export-stage .preview-cta {
  padding: 28px 38px;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .workspace,
  .pin-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .status-strip {
    justify-content: start;
  }

  .composer {
    position: static;
  }
}

@media (max-width: 620px) {
  #modalPreviewContent .design-preview {
    padding: 24px;
  }

  #modalPreviewContent .preview-copy h2 {
    font-size: 36px;
  }

  #modalPreviewContent .preview-subheadline,
  #modalPreviewContent .preview-copy blockquote {
    font-size: 16px;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 28px;
  }

  .actions,
  .pin-fields,
  .card-actions {
    grid-template-columns: 1fr;
  }
}
