:root {
  --bg: #edf0e9;
  --surface: #fbfcf8;
  --surface-2: #f4f7f0;
  --ink: #132435;
  --ink-soft: #4b5d6c;
  --line: #d5dde1;
  --teal: #095f7d;
  --teal-strong: #06455b;
  --sand: #f1ca63;
  --ok: #1f7a4a;
  --warn: #af6d00;
  --danger: #aa3a2d;
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-sm: 10px;
  --shadow: 0 16px 46px rgba(16, 35, 50, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 6% 12%, rgba(9, 95, 125, 0.1), transparent 34%),
    radial-gradient(circle at 92% 20%, rgba(241, 202, 99, 0.24), transparent 28%),
    linear-gradient(180deg, #f8fbf6 0%, #e8eee4 100%);
}

.shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-header {
  margin-top: 1rem;
  margin-bottom: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand-label {
  margin: 0;
  font-size: 0.72rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.app-header h1 {
  margin: 0.18rem 0 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.16rem, 1.9vw, 1.5rem);
}

.main-nav {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.44rem 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn.is-active {
  border-color: rgba(9, 95, 125, 0.26);
  color: var(--teal);
  background: #fff;
}

.nav-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0.95rem;
  margin-bottom: 1rem;
}

.left-rail {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.rail-card,
.panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 0.95rem;
}

.rail-card h2,
.panel h3 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.rail-card h2 {
  font-size: 1rem;
  margin-bottom: 0.52rem;
}

label {
  display: grid;
  gap: 0.33rem;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.62rem 0.72rem;
  color: var(--ink);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(9, 95, 125, 0.14);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  padding: 0.62rem 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover:enabled {
  background: var(--teal-strong);
  transform: translateY(-1px);
}

button.secondary {
  margin-top: 0.55rem;
  background: #184f64;
}

button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}

button:disabled {
  background: #99a9b3;
  cursor: not-allowed;
}

.status {
  margin: 0.52rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  min-height: 1.1rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.3rem 0.45rem;
  margin: 0;
}

.meta-grid.compact {
  grid-template-columns: 120px 1fr;
}

.meta-grid dt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.meta-grid dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.81rem;
  overflow-wrap: anywhere;
}

.progress-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.4rem;
}

.progress-item {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.progress-item.is-active {
  color: var(--teal);
  font-weight: 700;
}

.progress-item.is-done {
  color: var(--ok);
  font-weight: 700;
}

.stage {
  min-height: 400px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: 1.16fr 1fr;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.hero-copy,
.hero-media {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 1.1rem;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.hero-copy h2 {
  margin: 0.6rem 0 0.72rem;
  line-height: 1.12;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 2.8vw, 2.45rem);
}

.hero-copy p,
.hero-copy li {
  color: var(--ink-soft);
}

.hero-copy ul {
  margin: 0.9rem 0 0;
  padding-left: 1.05rem;
}

.path-ribbon {
  margin-top: 0.7rem;
  width: 100%;
}

.hero-media {
  padding: 0.66rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 222px 180px;
  gap: 0.64rem;
}

.hero-image {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(140deg, #d9e6ea, #edf3f5);
}

.hero-image-lg {
  grid-column: span 2;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.forms-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel-head {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  margin-bottom: 0.62rem;
}

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

form {
  display: grid;
  gap: 0.56rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.56rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.inline-actions {
  display: flex;
  gap: 0.52rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.question-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.68rem;
  background: var(--surface-2);
  margin-bottom: 0.7rem;
}

.question-box h4 {
  margin: 0 0 0.42rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 0.96rem;
}

.question-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.4rem;
}

.question-list li {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.chat-thread {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  min-height: 190px;
  max-height: 360px;
  overflow: auto;
  padding: 0.7rem;
  margin-bottom: 0.68rem;
  display: grid;
  gap: 0.5rem;
}

.chat-bubble {
  border-radius: 12px;
  padding: 0.55rem 0.62rem;
  font-size: 0.83rem;
  line-height: 1.4;
}

.chat-bubble.user {
  background: #e4f0f5;
  border: 1px solid #c8dde8;
}

.chat-bubble.assistant {
  background: #f6f6f2;
  border: 1px solid #dde3dc;
}

.chat-role {
  margin-bottom: 0.28rem;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--teal);
}

.draft-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 0.8rem;
  margin-bottom: 0.7rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.markdown-body p {
  margin-top: 0;
  margin-bottom: 0.48rem;
  color: #243848;
}

.markdown-body ul {
  margin-top: 0;
  margin-bottom: 0.48rem;
  padding-left: 1rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.78rem;
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.44rem;
}

.checklist li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.activity-list,
.version-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.activity-list li,
.version-list li {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.54rem 0.6rem;
  background: var(--surface-2);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.activity-time {
  color: #738291;
  font-size: 0.75rem;
  display: block;
  margin-top: 0.22rem;
}

.footer {
  margin-bottom: 1rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: inUp 480ms ease forwards;
}

.reveal-a {
  animation-delay: 60ms;
}

.reveal-b {
  animation-delay: 140ms;
}

.reveal-c {
  animation-delay: 220ms;
}

@keyframes inUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .hero {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 760px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-media {
    grid-template-rows: 180px 130px;
  }

  .inline-actions {
    flex-direction: column;
  }
}
