:root {
  --bg: #f5ecdc;
  --bg-deep: #ead7bd;
  --paper: #fffdfa;
  --surface: rgba(255, 252, 247, 0.76);
  --surface-strong: rgba(255, 250, 242, 0.94);
  --ink: #1d2f36;
  --muted: #58656d;
  --line: rgba(29, 47, 54, 0.12);
  --accent: #d96b3a;
  --accent-deep: #ab4f27;
  --teal: #2d7f72;
  --honey: #e4b550;
  --shadow: 0 28px 80px rgba(36, 40, 39, 0.14);
  font-family: "Manrope", "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(228, 181, 80, 0.28), transparent 34%),
    linear-gradient(180deg, #f8f1e7 0%, #f3eadf 40%, #efe4d5 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: transparent;
}

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

button {
  cursor: pointer;
}

.page-orb {
  position: fixed;
  inset: auto;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.page-orb-left {
  top: -6rem;
  left: -5rem;
  background: radial-gradient(circle, rgba(217, 107, 58, 0.36), rgba(217, 107, 58, 0));
}

.page-orb-right {
  right: -7rem;
  bottom: 6rem;
  background: radial-gradient(circle, rgba(45, 127, 114, 0.34), rgba(45, 127, 114, 0));
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2rem) 3rem;
}

.hero {
  display: block;
  margin-bottom: 1.5rem;
}

.hero-copy,
.panel,
.preview-toolbar,
.report-sheet {
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
}

.hero-copy,
.panel,
.preview-toolbar {
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.hero-copy {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 32px;
}

.eyebrow,
.panel-kicker,
.report-kicker,
.meta-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 800;
}

.eyebrow,
.panel-kicker,
.report-kicker {
  color: var(--accent-deep);
}

.hero h1,
.panel h2,
.preview-toolbar h2,
.report-title,
.foundation-summary h3 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  line-height: 1;
}

.hero h1 {
  margin-top: 0.55rem;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  max-width: 10ch;
}

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

.editor-form {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.2rem;
  border-radius: 28px;
}

.panel-heading,
.preview-toolbar,
.photo-section-header,
.report-footer,
.action-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.panel-heading h2,
.preview-toolbar h2 {
  margin-top: 0.4rem;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.panel-note,
.preview-note,
.photo-caption,
.draft-status,
.report-footer,
.foundation-note,
.helper-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field span,
.field-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.field-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.field-title strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.9rem 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(45, 127, 114, 0.68);
  box-shadow: 0 0 0 4px rgba(45, 127, 114, 0.12);
}

input[readonly] {
  background: rgba(244, 236, 220, 0.9);
}

.domain-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.domain-pill {
  border: 1px solid rgba(29, 47, 54, 0.08);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.domain-pill:hover {
  transform: translateY(-1px);
}

.domain-pill.is-active {
  background: linear-gradient(135deg, var(--teal), #245e56);
  color: #f7f3eb;
  border-color: transparent;
}

.foundation-note {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(228, 181, 80, 0.18), rgba(217, 107, 58, 0.08));
  border: 1px solid rgba(217, 107, 58, 0.12);
}

.upload-field {
  display: grid;
  place-items: center;
  min-height: 7rem;
  border: 1.5px dashed rgba(45, 127, 114, 0.35);
  background:
    linear-gradient(135deg, rgba(45, 127, 114, 0.08), rgba(228, 181, 80, 0.12)),
    rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 1rem;
  text-align: center;
  font-weight: 800;
  color: var(--teal);
}

.upload-field input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.photo-item {
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.photo-thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  display: block;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
}

.photo-name {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-photo {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(29, 47, 54, 0.08);
  color: var(--ink);
  font-weight: 700;
}

.empty-photos {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.action-row {
  flex-wrap: wrap;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff6f1;
}

.button-secondary {
  background: linear-gradient(135deg, rgba(228, 181, 80, 0.95), rgba(217, 107, 58, 0.75));
  color: #312318;
}

.button-ghost {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid rgba(29, 47, 54, 0.08);
}

.draft-status[data-tone="warn"] {
  color: var(--accent-deep);
}

.preview-panel {
  position: sticky;
  top: 1rem;
}

.preview-toolbar {
  padding: 1rem 1.2rem;
  border-radius: 26px;
  margin-bottom: 1rem;
}

.report-sheet {
  background: var(--paper);
  border-radius: 34px;
  padding: clamp(1.2rem, 2vw, 1.6rem);
  display: grid;
  gap: 1rem;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.report-title {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 3vw, 2.5rem);
}

.report-badge {
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(45, 127, 114, 0.12), rgba(228, 181, 80, 0.18));
  color: var(--teal);
  font-weight: 800;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.meta-card,
.content-card,
.stacked-cards {
  border-radius: 24px;
}

.meta-card,
.content-card {
  border: 1px solid rgba(29, 47, 54, 0.09);
  background: #ffffff;
  padding: 0.95rem 1rem;
}

.meta-card strong {
  margin-top: 0.45rem;
  display: block;
  font-size: 0.98rem;
}

.foundation-strip {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(45, 127, 114, 0.14), rgba(255, 253, 250, 0.92) 35%, rgba(228, 181, 80, 0.18));
  border: 1px solid rgba(29, 47, 54, 0.08);
}

.foundation-domain {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
}

.foundation-domain span {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--teal);
}

.foundation-domain strong {
  font-size: 1.05rem;
}

.foundation-domain small {
  color: var(--muted);
  font-size: 0.82rem;
}

.foundation-summary h3 {
  margin-top: 0.45rem;
  font-size: 1.6rem;
}

.foundation-summary p:last-child {
  margin: 0.6rem 0 0;
  line-height: 1.55;
  color: var(--muted);
}

.report-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0.85rem;
  align-items: start;
}

.content-card {
  min-height: 100%;
}

.content-card-large {
  min-height: 15rem;
}

.stacked-cards {
  display: grid;
  gap: 0.85rem;
}

.report-copy {
  margin: 0.55rem 0 0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.placeholder {
  color: #7d888d;
}

.photo-section {
  display: grid;
  gap: 0.75rem;
}

.preview-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.preview-photo-card {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(29, 47, 54, 0.08);
  background: #fffaf1;
  aspect-ratio: 4 / 3;
}

.preview-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-photo-card.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

.report-footer {
  border-top: 1px solid rgba(29, 47, 54, 0.08);
  padding-top: 0.9rem;
  flex-wrap: wrap;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 1rem 0.8rem 2rem;
  }

  .field-grid,
  .meta-grid,
  .report-columns,
  .preview-photos,
  .photo-list,
  .foundation-strip {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .preview-toolbar,
  .photo-section-header,
  .report-footer {
    flex-direction: column;
  }

  .domain-selector {
    display: grid;
  }

  .report-sheet {
    border-radius: 26px;
  }
}

@page {
  size: letter;
  margin: 0.32in;
}

@media print {
  :root {
    background: #ffffff;
  }

  body {
    background: #ffffff;
  }

  .page-orb,
  .hero,
  .editor-panel,
  .preview-toolbar {
    display: none !important;
  }

  .app-shell {
    max-width: none;
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .preview-panel {
    position: static;
  }

  .report-sheet {
    display: grid;
    grid-template-columns: 1.8in minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "photo meta"
      "foundation foundation"
      "content content"
      "footer footer";
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    gap: 0.32rem 0.42rem;
    page-break-inside: avoid;
  }

  .meta-card,
  .content-card,
  .foundation-strip,
  .preview-photo-card {
    break-inside: avoid;
  }

  .report-header {
    grid-area: header;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .photo-section {
    grid-area: photo;
    align-content: start;
    gap: 0.2rem;
  }

  .meta-grid {
    grid-area: meta;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.32rem;
  }

  .foundation-strip {
    grid-area: foundation;
    grid-template-columns: 1.45in minmax(0, 1fr);
    gap: 0.42rem;
  }

  .report-columns {
    grid-area: content;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: 0.32rem;
  }

  .report-footer {
    grid-area: footer;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
  }

  .report-title {
    margin-top: 0.18rem;
    font-size: 21pt;
  }

  .foundation-summary h3 {
    margin-top: 0.18rem;
    font-size: 13pt;
  }

  .report-copy,
  .foundation-summary p:last-child,
  .report-footer,
  .meta-card strong {
    font-size: 9pt;
    line-height: 1.22;
  }

  .report-header,
  .photo-section-header,
  .report-footer {
    gap: 0.3rem;
  }

  .report-kicker,
  .meta-label,
  .foundation-domain span {
    font-size: 7pt;
  }

  .photo-section-header {
    display: block;
  }

  .photo-section-header .meta-label {
    margin-bottom: 0.12rem;
  }

  .report-badge {
    display: none;
  }

  .meta-grid,
  .report-columns,
  .preview-photos {
    gap: 0.32rem;
  }

  .stacked-cards {
    gap: 0.32rem;
  }

  .meta-card,
  .content-card {
    border-radius: 12px;
    padding: 0.42rem 0.5rem;
  }

  .foundation-strip {
    padding: 0.45rem 0.55rem;
    border-radius: 14px;
  }

  .foundation-domain strong {
    font-size: 10pt;
  }

  .content-card-large {
    min-height: 0;
  }

  .preview-photos {
    grid-template-columns: 1fr;
  }

  .preview-photo-card {
    aspect-ratio: auto;
    height: 1.75in;
    border-radius: 14px;
  }

  .preview-photo-card.empty {
    height: 1.2in;
    padding: 0.35rem;
    font-size: 8pt;
  }

  .preview-photos.has-multiple {
    gap: 0.14rem;
  }

  .report-sheet.has-multiple-photos .preview-photo-card {
    height: 0.82in;
  }

  .report-sheet.has-multiple-photos .photo-section {
    gap: 0.14rem;
  }

  .photo-caption,
  .preview-note,
  .draft-status,
  .foundation-domain small {
    font-size: 8pt;
  }

  #preview-saved-at {
    display: none;
  }
}
