:root {
  --cherry: #c32148;
  --blush: #fbeae7;
  --ivory: #f9f7f4;
  --black: #0d0d0d;
  --gold: #d4af37;
  --deep-cherry: #741328;
  --soft-cherry: #9f1d3d;
  --bone: #efe6dc;
  --line: rgba(13, 13, 13, 0.14);
  --shadow: 0 22px 70px rgba(195, 33, 72, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(195, 33, 72, 0.14), transparent 28rem),
    linear-gradient(135deg, var(--ivory), #fff7f4 45%, var(--blush));
  color: var(--black);
  font-family: "Poppins", system-ui, sans-serif;
}

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

button,
a,
label.file-label {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.4rem;
  background: var(--black);
  color: var(--ivory);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12rem;
  font-size: clamp(2.25rem, 3vw, 3.4rem);
}

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

h3 {
  font-size: clamp(1.55rem, 2vw, 2.35rem);
}

h4 {
  font-size: 1.45rem;
}

.brand-block p:last-child {
  margin: 0.85rem 0 0;
  color: rgba(249, 247, 244, 0.74);
  line-height: 1.6;
}

.mobile-nav-toggle {
  display: none;
}

.phase-nav {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.nav-btn {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.72rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ivory);
  text-align: left;
  cursor: pointer;
}

.nav-btn:hover,
.nav-btn.active {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.nav-number {
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
}

.nav-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.status-pill {
  min-width: 4.7rem;
  padding: 0.24rem 0.45rem;
  border-radius: 999px;
  background: rgba(249, 247, 244, 0.1);
  color: rgba(249, 247, 244, 0.82);
  font-size: 0.68rem;
  text-align: center;
}

.status-complete {
  background: rgba(212, 175, 55, 0.22);
  color: #ffeab7;
}

.status-ready {
  background: rgba(195, 33, 72, 0.35);
  color: white;
}

.sidebar-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.main-panel {
  min-width: 0;
  padding: 1.2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0 1.2rem;
}

.save-state {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  background: rgba(255, 255, 255, 0.58);
  color: var(--soft-cherry);
  font-size: 0.83rem;
  font-weight: 700;
}

.view-panel {
  display: grid;
  gap: 1rem;
}

.workflow-guide {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.workflow-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.workflow-step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--black);
  font-size: 0.78rem;
  cursor: pointer;
}

.workflow-step span {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--bone);
  font-size: 0.7rem;
  font-weight: 700;
}

.workflow-step.current { background: var(--blush); color: var(--cherry); font-weight: 700; }
.workflow-step.current span { background: var(--cherry); color: white; }
.workflow-step.done span { background: var(--gold); color: var(--black); }
.workflow-line i { color: var(--soft-cherry); font-style: normal; }

.workflow-handoff {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.workflow-handoff div { display: grid; gap: 0.12rem; }
.workflow-handoff b { color: var(--soft-cherry); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.workflow-handoff span { font-size: 0.83rem; }

.dashboard-grid,
.two-col,
.three-col {
  display: grid;
  gap: 1rem;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.statement-card,
.phase-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.card {
  padding: 1rem;
}

.featured-action {
  border: 2px solid var(--cherry);
  box-shadow: var(--shadow);
}

.soft-action {
  background: rgba(251, 234, 231, 0.72);
  box-shadow: none;
}

.compact-fields {
  margin-top: 1rem;
}

.field-action {
  margin-top: 0.55rem;
}

.shortlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.shortlist-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(249, 247, 244, 0.8);
}

.shortlist-card.chosen {
  border: 2px solid var(--cherry);
  background: var(--blush);
}

.shortlist-card h4 { font-size: 1.7rem; }
.shortlist-card p { margin: 0; line-height: 1.55; }
.shortlist-meta { display: flex; flex-wrap: wrap; gap: 0.45rem; color: var(--soft-cherry); font-size: 0.8rem; font-weight: 700; }
.shortlist-meta span { padding: 0.25rem 0.45rem; border-radius: 999px; background: rgba(195, 33, 72, 0.1); }
.empty-state { display: grid; gap: 0.25rem; padding: 1.1rem; border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,0.45); }

.archive-list { display: grid; gap: 0.6rem; margin-top: 1rem; }
.archive-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(249,247,244,0.75); }
.archive-row div { display: grid; gap: 0.15rem; }
.archive-row span { color: var(--soft-cherry); font-size: 0.8rem; }

details.card {
  align-self: start;
}

details.card > summary,
details > summary {
  cursor: pointer;
  font-weight: 700;
}

details.card > summary {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
}

details.card[open] > summary {
  margin-bottom: 1rem;
}

.statement-card {
  padding: clamp(1.1rem, 2vw, 1.6rem);
  background: linear-gradient(135deg, var(--cherry), #8c1738);
  color: white;
}

.statement-card .eyebrow,
.statement-card strong {
  color: #ffe2a4;
}

.statement-card p {
  max-width: 45rem;
  color: rgba(255, 255, 255, 0.84);
}

.phase-card {
  padding: 0.95rem;
}

.phase-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

p {
  line-height: 1.65;
}

.muted {
  color: rgba(13, 13, 13, 0.64);
}

.small {
  font-size: 0.86rem;
}

.rule {
  height: 1px;
  margin: 0.85rem 0;
  background: var(--line);
}

.progress-track {
  height: 0.72rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(13, 13, 13, 0.1);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cherry), var(--gold));
  transition: width 0.25s ease;
}

.phase-path {
  display: grid;
  gap: 0.6rem;
}

.path-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(249, 247, 244, 0.75);
}

.path-dot {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--blush);
  color: var(--cherry);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.actions,
.inline-actions,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.72rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.primary-btn {
  border: 1px solid var(--cherry);
  background: var(--cherry);
  color: white;
}

.secondary-btn {
  border: 1px solid var(--black);
  background: var(--black);
  color: white;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--black);
}

.sidebar .ghost-btn {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ivory);
}

.danger-btn {
  border: 1px solid rgba(195, 33, 72, 0.25);
  background: rgba(195, 33, 72, 0.08);
  color: var(--cherry);
}

.field {
  display: grid;
  gap: 0.42rem;
  margin-bottom: 0.85rem;
}

.field span,
.check-row span,
.mini-label {
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--black);
  outline: none;
}

input,
select {
  min-height: 2.85rem;
  padding: 0.75rem;
}

textarea {
  min-height: 7.5rem;
  padding: 0.85rem;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cherry);
  box-shadow: 0 0 0 3px rgba(195, 33, 72, 0.14);
}

.question-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.check-list {
  display: grid;
  gap: 0.65rem;
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(249, 247, 244, 0.68);
}

.check-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-height: auto;
  accent-color: var(--cherry);
}

.check-row select {
  width: 9rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.45rem;
}

.recommendation-list {
  display: grid;
  gap: 0.7rem;
}

.recommend-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 234, 231, 0.55);
}

.recommend-card.selected {
  border-color: var(--cherry);
  box-shadow: 0 0 0 3px rgba(195, 33, 72, 0.12);
}

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

.resource-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

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

.metric {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.metric strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--cherry);
  font-size: 1.2rem;
}

.prompt-drawer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(13, 13, 13, 0.54);
}

.prompt-drawer.open {
  display: grid;
}

.drawer-card {
  width: min(58rem, 100%);
  max-height: 92vh;
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--ivory);
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--black);
  font-size: 1.35rem;
  cursor: pointer;
}

#promptOutput {
  min-height: 50vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.toast {
  animation: pulseSave 0.8s ease;
}

@keyframes pulseSave {
  0% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    min-height: 2.65rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ivory);
    font-weight: 800;
    text-transform: uppercase;
  }

  .phase-nav {
    display: none;
  }

  .phase-nav.open {
    display: grid;
  }

  .dashboard-grid,
  .two-col,
  .three-col,
  .resource-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .main-panel {
    padding: 0.85rem;
  }

  .topbar {
    display: grid;
  }

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

  .check-row select {
    grid-column: 1 / -1;
    width: 100%;
  }

  .actions,
  .inline-actions,
  .drawer-actions {
    display: grid;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }
}
