﻿@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@600;700&family=Rubik:wght@400;500;700&display=swap');

:root {
  --bg: #f6f0e6;
  --ink: #1d1b16;
  --muted: #5e564a;
  --accent: #f26b4f;
  --accent-2: #1f9aa7;
  --card: #fff8ee;
  --line: rgba(29, 27, 22, 0.12);
  --shadow: 0 20px 50px rgba(29, 27, 22, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Rubik', sans-serif;
  background: radial-gradient(circle at 10% 10%, #fff7ec 0%, var(--bg) 45%, #f1e7d8 100%);
  color: var(--ink);
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.35;
  z-index: 0;
}

.orb-a {
  background: radial-gradient(circle at 30% 30%, #f26b4f 0%, transparent 70%);
  top: -140px;
  right: -80px;
}

.orb-b {
  background: radial-gradient(circle at 40% 40%, #1f9aa7 0%, transparent 70%);
  bottom: -120px;
  left: -120px;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" stitchTiles="stitch"/></filter><rect width="140" height="140" filter="url(%23n)" opacity="0.15"/></svg>');
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 1;
}

.app {
  position: relative;
  z-index: 2;
  padding: 32px 36px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

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

.logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #f8b195);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 24px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(242, 107, 79, 0.25);
}

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

.file-label {
  padding: 10px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.file-label input {
  display: none;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
}

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

.panel-header h2 {
  margin: 0;
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 20px;
}

.tag {
  background: rgba(31, 154, 167, 0.1);
  color: #136d77;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-row input {
  flex: 1;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip input {
  accent-color: var(--accent);
}

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

.existing-fields {
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}

.existing-fields .field:last-child {
  margin-bottom: 0;
}

.hidden {
  display: none;
}

.idea-card {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.idea-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-family: 'Frank Ruhl Libre', serif;
}

.idea-grid {
  display: grid;
  gap: 12px;
}

.idea-grid h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted);
}

.idea-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.goal-box {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
}

.goal-label {
  color: var(--muted);
  font-size: 12px;
}

.goal-text {
  font-weight: 600;
}

.step-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.step-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.step-check-wrap {
  display: inline-flex;
  position: relative;
  width: 44px;
  height: 44px;
}

.step-check {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #fff;
  position: relative;
}

.step-check::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.step-check-wrap input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.step-check-wrap input:checked + .step-check::after {
  opacity: 1;
  transform: scale(1);
}

.step-title {
  font-weight: 600;
}

.step-meta {
  font-size: 12px;
  color: var(--muted);
}

.step-desc {
  margin: 0 0 12px;
  color: var(--muted);
}

.step-deliverable {
  background: rgba(242, 107, 79, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.issue-box {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.issue-box textarea {
  min-height: 90px;
}

.issue-helper {
  color: var(--muted);
  font-size: 12px;
}

.progress-box {
  margin-bottom: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-track {
  background: #f0e6d8;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #f8b195);
  transition: width 0.3s ease;
}

.next-steps ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.next-steps li {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 13px;
}

.chat-log {
  min-height: 260px;
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 6px;
}

.chat-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.chat-bubble.user {
  background: rgba(31, 154, 167, 0.12);
  color: #0f4f56;
}

.chat-controls {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.debug-box textarea {
  min-height: 140px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
}

.chat-input-row {
  display: grid;
  gap: 10px;
}

.chat-input-row textarea {
  min-height: 90px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
}

.settings {
  border: none;
  border-radius: 24px;
  padding: 24px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.settings-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .actions {
    width: 100%;
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .app {
    padding: 24px 18px 40px;
  }

  .input-row {
    flex-direction: column;
  }
}
