:root {
  --bg: #f8f3e8;
  --bg-deep: #ece3d2;
  --ink: #11231d;
  --muted: #4f645d;
  --line: rgba(17, 35, 29, 0.12);
  --card: rgba(255, 252, 246, 0.82);
  --card-strong: rgba(255, 250, 241, 0.94);
  --accent: #d6593f;
  --accent-soft: rgba(214, 89, 63, 0.14);
  --accent-deep: #8f2f20;
  --green: #0f6b57;
  --gold: #b9822d;
  --shadow: 0 30px 80px rgba(17, 35, 29, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(233, 202, 136, 0.34), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(15, 107, 87, 0.18), transparent 24%),
    linear-gradient(180deg, #fffaf2 0%, var(--bg) 45%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

code {
  font-family: "Manrope", sans-serif;
  background: rgba(17, 35, 29, 0.07);
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  filter: blur(26px);
  opacity: 0.7;
}

.ambient-a {
  width: 320px;
  height: 320px;
  top: 8%;
  right: -70px;
  background: rgba(214, 89, 63, 0.18);
  animation: floaty 11s ease-in-out infinite;
}

.ambient-b {
  width: 420px;
  height: 420px;
  bottom: 0;
  left: -80px;
  background: rgba(15, 107, 87, 0.16);
  animation: floaty 15s ease-in-out infinite reverse;
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
  position: relative;
}

.hero,
.settings-panel,
.tabs-shell,
.workspace-card,
.results-card,
.provider-card,
.summary-card {
  backdrop-filter: blur(18px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 28px;
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.65), transparent 45%),
    linear-gradient(0deg, transparent, rgba(255, 255, 255, 0.25));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent-deep);
  font-weight: 800;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 0.98;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  max-width: 9ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.1rem;
}

.hero-text,
.section-heading p,
.provider-note,
.summary-card,
.workspace-card,
.results-card {
  color: var(--muted);
}

.hero-card {
  align-self: stretch;
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(15, 107, 87, 0.16), rgba(255, 255, 255, 0.76)),
    rgba(255, 250, 245, 0.88);
  border: 1px solid rgba(15, 107, 87, 0.16);
}

.hero-card-label {
  margin: 0 0 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--green);
}

.hero-card-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
  color: var(--ink);
}

.settings-panel,
.tabs-shell {
  margin-top: 26px;
  border-radius: var(--radius-xl);
  padding: 28px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.section-heading.tight {
  margin-bottom: 20px;
}

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

.provider-card,
.workspace-card,
.results-card {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.provider-card-head,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 107, 87, 0.1);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
}

.field,
.field-row {
  display: grid;
  gap: 10px;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.field-row.compact {
  grid-template-columns: repeat(2, minmax(120px, 180px));
}

.field span,
.choice-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(214, 89, 63, 0.5);
  box-shadow: 0 0 0 4px rgba(214, 89, 63, 0.12);
  transform: translateY(-1px);
}

.provider-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 35, 29, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill.is-success {
  background: rgba(15, 107, 87, 0.14);
  color: var(--green);
}

.status-pill.is-error {
  background: rgba(214, 89, 63, 0.16);
  color: var(--accent-deep);
}

.provider-note {
  margin: 14px 0 0;
  line-height: 1.55;
}

.tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.tab:hover,
.pill-choice:hover,
.btn:hover {
  transform: translateY(-2px);
}

.tab.is-active {
  background: linear-gradient(135deg, var(--accent), #e38d4d);
  color: white;
  box-shadow: 0 16px 34px rgba(214, 89, 63, 0.26);
}

.tab-panel {
  display: none;
  animation: reveal 280ms ease;
}

.tab-panel.is-active {
  display: block;
}

.panel-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 22px;
}

.workspace-card,
.results-card {
  min-height: 100%;
}

.choice-block {
  margin-top: 18px;
}

.toggle-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pill-choice {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(17, 35, 29, 0.08);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: all 180ms ease;
}

.pill-choice.is-selected {
  background: rgba(15, 107, 87, 0.14);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 87, 0.18);
}

.animated-box {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  opacity: 1;
  max-height: 420px;
  overflow: hidden;
  transform: translateY(0);
  transition: opacity 220ms ease, max-height 220ms ease, transform 220ms ease, margin-top 220ms ease;
}

.animated-box.hidden {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ink), #28473e);
  color: white;
  box-shadow: 0 16px 34px rgba(17, 35, 29, 0.24);
}

.btn-secondary {
  background: rgba(17, 35, 29, 0.08);
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.summary-card {
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--card-strong);
  line-height: 1.6;
}

.asset-group {
  margin-top: 22px;
}

.asset-grid,
.copy-grid,
.chip-grid,
.headline-grid {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

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

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

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

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

.name-chip,
.asset-card,
.copy-card,
.headline-card {
  border-radius: 18px;
  border: 1px solid rgba(17, 35, 29, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.name-chip {
  padding: 16px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.name-chip.is-selected {
  border-color: rgba(15, 107, 87, 0.32);
  box-shadow: 0 16px 34px rgba(15, 107, 87, 0.12);
  transform: translateY(-2px);
}

.name-chip-title {
  font-weight: 800;
  color: var(--ink);
}

.asset-card {
  overflow: hidden;
}

.asset-media {
  position: relative;
  aspect-ratio: var(--asset-ratio, 1 / 1);
  background:
    linear-gradient(135deg, rgba(15, 107, 87, 0.14), rgba(214, 89, 63, 0.12)),
    rgba(247, 240, 231, 0.95);
}

.asset-card img {
  width: 100%;
  display: block;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.asset-body,
.copy-card {
  padding: 16px;
}

.asset-body {
  display: grid;
  gap: 10px;
}

.overlay-plan {
  display: grid;
  gap: 8px;
}

.overlay-chip {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(214, 89, 63, 0.08);
  border: 1px solid rgba(214, 89, 63, 0.12);
}

.overlay-chip-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  font-weight: 800;
}

.overlay-chip strong {
  color: var(--ink);
  line-height: 1.4;
}

.asset-meta,
.copy-meta {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.asset-actions,
.copy-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 107, 87, 0.12);
  color: var(--green);
  text-decoration: none;
  font-weight: 800;
}

.copy-card {
  display: grid;
  gap: 10px;
}

.headline-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.copy-card h4 {
  font-size: 1.16rem;
}

.copy-value {
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
}

.headline-value {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.4;
  font-weight: 800;
}

.loader {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(17, 35, 29, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.small-field {
  max-width: 180px;
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.upload-preview-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(17, 35, 29, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.upload-preview-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.upload-preview-card span {
  display: block;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  min-width: 240px;
  max-width: 88vw;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(17, 35, 29, 0.92);
  color: white;
  box-shadow: 0 18px 40px rgba(17, 35, 29, 0.22);
  z-index: 30;
  animation: reveal 220ms ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes floaty {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -24px, 0) scale(1.06);
  }
}

@media (max-width: 1080px) {
  .hero,
  .provider-grid,
  .panel-layout {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1360px);
    padding-top: 18px;
  }

  .hero,
  .settings-panel,
  .tabs-shell,
  .provider-card,
  .workspace-card,
  .results-card {
    padding: 20px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field-row.compact {
    grid-template-columns: 1fr 1fr;
  }

  .provider-actions,
  .asset-actions,
  .copy-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
