:root {
  --paper: #faf7ef;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #747b82;
  --line: #dedbd3;
  --deep: #14725f;
  --clay: #e25b32;
  --gold: #d9a331;
  --blue: #1d6f9f;
  --soft-green: #e8f1ee;
  --soft-clay: #f7e8e4;
  --shadow: 0 16px 44px rgba(47, 51, 55, 0.12);
  --soft-shadow: 0 14px 34px rgba(41, 34, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 24px 20px;
  background: #f4efe5;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(36, 40, 45, 0.12);
}

.brand-title {
  font-weight: 760;
  line-height: 1.15;
}

.brand-subtitle,
.project-meta,
.section-label,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0;
}

.primary-action,
.main-button {
  border: 0;
  border-radius: 10px;
  background: var(--deep);
  color: white;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(31, 111, 104, 0.22);
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.plus {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.sidebar-section {
  min-height: 0;
  flex: 1;
}

.section-label {
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.project-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 245px);
  overflow: auto;
  padding-right: 4px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 4px;
  align-items: stretch;
}

.project-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 10px;
  color: var(--ink);
}

.project-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--soft-green);
  color: var(--deep);
  font-weight: 900;
}

.project-text {
  min-width: 0;
}

.project-row:hover .project-item,
.project-row.is-active .project-item {
  background: var(--panel);
  border-color: var(--line);
}

.project-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.project-text > span {
  color: var(--muted);
  font-size: 12px;
}

.delete-project {
  width: 30px;
  min-height: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #9a5146;
  font-size: 22px;
  line-height: 1;
}

.delete-project:hover,
.delete-project:focus {
  border-color: #e2c6c1;
  background: var(--soft-clay);
  outline: none;
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 14px 22px;
}

.intro {
  min-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 198px auto auto;
  gap: 10px;
  align-items: stretch;
  max-width: 1220px;
  margin: 0 auto;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.55fr);
  align-items: center;
  min-height: 198px;
  border: 1px solid rgba(222, 219, 211, 0.72);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(250,243,230,0.86));
  box-shadow: var(--soft-shadow);
  padding: 16px 30px;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 360px;
  height: 180px;
  background: radial-gradient(circle, rgba(226,91,50,0.08), transparent 68%);
  pointer-events: none;
}

.intro h1 {
  margin: 5px 0 6px;
  max-width: 720px;
  font-size: clamp(32px, 3vw, 42px);
  line-height: 1.06;
  letter-spacing: 0;
}

.intro p {
  max-width: 640px;
  color: #555d64;
  font-size: 14px;
  line-height: 1.3;
}

.hero-visual {
  position: relative;
  min-height: 156px;
}

.visual-card {
  position: absolute;
  right: 28px;
  bottom: 6px;
  width: 142px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #f6ead7;
  transform: rotate(13deg);
  box-shadow: 0 20px 38px rgba(75, 57, 35, 0.16);
}

.visual-card img {
  width: 68px;
  height: 68px;
}

.lightbulb {
  position: absolute;
  top: 12px;
  right: 108px;
  width: 58px;
  height: 70px;
  border: 5px solid #172436;
  border-radius: 46px 46px 34px 34px;
  background: #f6c75a;
  box-shadow: inset 0 -12px 0 rgba(20, 114, 95, 0.25);
}

.lightbulb::after {
  content: "";
  position: absolute;
  left: 21px;
  bottom: -18px;
  width: 30px;
  height: 18px;
  border: 5px solid #172436;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #7f9d8d;
}

.shape {
  position: absolute;
  border-radius: 50%;
}

.shape-one {
  width: 76px;
  height: 76px;
  right: 172px;
  bottom: 58px;
  background: rgba(20, 114, 95, 0.88);
}

.shape-two {
  width: 20px;
  height: 20px;
  right: 262px;
  top: 48px;
  background: #f2bf55;
}

.shape-three {
  width: 18px;
  height: 18px;
  right: 8px;
  bottom: 76px;
  background: #172436;
  border-radius: 4px;
  transform: rotate(45deg);
}

.grid-mark {
  position: absolute;
  top: -12px;
  right: 0;
  width: 112px;
  height: 96px;
  background-image:
    linear-gradient(rgba(217,163,49,0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,163,49,0.25) 1px, transparent 1px);
  background-size: 18px 18px;
}

.quick-start,
.how-it-works {
  display: grid;
  gap: 8px;
}

.quick-start h2,
.how-it-works h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.task-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.task-start-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.task-start-card:hover {
  transform: translateY(-3px);
  background: #fff;
  border-color: rgba(20, 114, 95, 0.25);
}

.task-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
}

.task-start-card strong {
  font-size: 14px;
  line-height: 1.15;
}

.task-start-card > span:not(.task-icon) {
  color: #3f4a54;
  font-size: 12px;
  line-height: 1.3;
}

.task-green .task-icon { background: #dcebe4; color: var(--deep); }
.task-coral .task-icon { background: #f8ded3; color: var(--clay); }
.task-lavender .task-icon { background: #eadff4; color: #8056b3; }
.task-blue .task-icon { background: #dbeaf3; color: var(--blue); }
.task-gold .task-icon { background: #f7e8bd; color: #c48600; }

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workflow-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  padding: 12px;
}

.workflow-card > strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--deep);
  font-size: 17px;
}

.workflow-card:nth-child(2) > strong { background: #f8e7c0; color: #c48600; }
.workflow-card:nth-child(3) > strong { background: #eadff4; color: #8056b3; }

.workflow-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.workflow-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.34;
}

.app-panel {
  max-width: 1260px;
  margin: 0 auto;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.header-actions {
  display: grid;
  gap: 8px;
  min-width: 154px;
}

.header-actions .ghost-button {
  width: 100%;
}

.project-title {
  width: min(720px, 70vw);
  border: 1px solid #cfd2d3;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 24px;
  font-weight: 740;
  line-height: 1.2;
  padding: 12px;
  margin-top: 7px;
}

.title-field {
  color: #3a3f45;
  font-weight: 700;
}

.project-title:focus {
  outline: 2px solid rgba(31, 111, 104, 0.25);
  border-color: var(--deep);
}

.ghost-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 650;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.steps {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: #ece7dc;
  border-radius: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.step {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #596168;
  padding: 0 14px;
  white-space: nowrap;
  font-weight: 700;
}

.step.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(36, 40, 45, 0.08);
}

.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

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

label {
  display: grid;
  gap: 7px;
  color: #3a3f45;
  font-weight: 700;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd2d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  resize: vertical;
}

textarea {
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(31, 111, 104, 0.25);
  border-color: var(--deep);
}

.boldness {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfaf7;
}

.slider-head,
.scale,
.stage-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.slider-head output {
  display: grid;
  place-items: center;
  width: 38px;
  height: 32px;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  font-weight: 800;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--deep);
}

.scale {
  color: var(--muted);
  font-size: 13px;
}

.stage-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.stage-top {
  margin-bottom: 18px;
}

.stage-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stage-top h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.stage-top p {
  margin: 0;
  color: var(--muted);
}

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

.idea-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.idea-card.is-selected {
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.14);
}

.idea-card h3,
.concept h3 {
  margin: 0;
  font-size: 20px;
}

.idea-card p,
.concept p {
  margin: 0;
  color: #485057;
  line-height: 1.5;
}

.idea-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.idea-tags span {
  border-radius: 999px;
  background: var(--soft-green);
  padding: 5px 9px;
  color: #245b55;
  font-size: 12px;
  font-weight: 700;
}

.frameworks {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 12px;
}

.frameworks > strong {
  color: var(--ink);
  font-size: 14px;
}

.frameworks p {
  font-size: 13px;
  line-height: 1.45;
}

.frameworks span {
  color: var(--deep);
  font-weight: 800;
}

.scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.score {
  border-radius: 8px;
  background: #f6f3ec;
  padding: 10px;
}

.score span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score strong {
  font-size: 20px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
}

.concept {
  display: grid;
  gap: 16px;
}

.concept-section {
  border-left: 4px solid var(--deep);
  background: #fbfaf7;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
}

.concept-section h4 {
  margin: 0 0 8px;
}

.concept-section:nth-child(3n) {
  border-color: var(--clay);
}

.concept-section:nth-child(4n) {
  border-color: var(--gold);
}

.concept ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #485057;
  line-height: 1.55;
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  border-radius: 8px;
  background: #24282d;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.work-indicator {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 64% 42%, rgba(20, 114, 95, 0.12), transparent 24%),
    rgba(250, 247, 239, 0.68);
  backdrop-filter: blur(4px);
}

.work-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  width: min(560px, calc(100vw - 42px));
  min-height: 190px;
  border: 1px solid rgba(222, 219, 211, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 70px rgba(25, 31, 38, 0.18);
  padding: 22px;
  overflow: hidden;
}

.work-indicator::after {
  content: attr(data-seconds);
  position: absolute;
  left: 50%;
  top: calc(50% + 112px);
  transform: translateX(-50%);
  border: 1px solid rgba(222, 219, 211, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.work-mark {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: #f4ead9;
  box-shadow: inset 0 0 0 1px rgba(222, 219, 211, 0.86);
}

.work-mark span {
  position: absolute;
  border-radius: 999px;
  animation: workPulse 1.8s ease-in-out infinite;
}

.work-mark span:nth-child(1) {
  width: 38px;
  height: 38px;
  left: 16px;
  top: 20px;
  background: var(--deep);
}

.work-mark span:nth-child(2) {
  width: 18px;
  height: 18px;
  right: 12px;
  top: 12px;
  background: var(--gold);
  animation-delay: 0.22s;
}

.work-mark span:nth-child(3) {
  width: 30px;
  height: 12px;
  right: 10px;
  bottom: 16px;
  border-radius: 999px 999px 999px 4px;
  background: var(--clay);
  transform: rotate(-28deg);
  animation-delay: 0.42s;
}

.work-kicker {
  margin: 0 0 6px;
  color: var(--deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.work-card h2 {
  margin: 0 0 8px;
  min-height: 30px;
  font-size: 26px;
  line-height: 1.1;
}

.work-card p {
  margin: 0;
  color: #535c64;
  line-height: 1.45;
}

#workMessage {
  min-height: 46px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.work-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.work-steps span {
  height: 5px;
  border-radius: 999px;
  background: #eee8dc;
  overflow: hidden;
}

.work-steps span::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--deep);
  transform: translateX(-100%);
}

.work-steps span.is-active::after {
  animation: workStep 4.5s linear forwards;
}

.hidden {
  display: none !important;
}

.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

@keyframes workPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.05);
  }
}

@keyframes workStep {
  to {
    transform: translateX(0);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    height: auto;
    overflow: visible;
  }

  .project-list {
    max-height: 220px;
  }

  .intro {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: auto;
  }

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

  .hero-visual {
    min-height: 180px;
  }

  .brief-grid,
  .ideas-grid,
  .task-card-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .task-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .workspace-header,
  .stage-top,
  .slider-head {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .project-title {
    width: 100%;
    font-size: 26px;
  }

  .intro h1 {
    font-size: 36px;
  }

  .intro p {
    font-size: 16px;
  }

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