:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --surface3: #22222f;
  --border: #2a2a3a;
  --accent: #7c6dfa;
  --accent2: #fa6d9f;
  --accent3: #6dfac0;
  --accent4: #fac06d;
  --text: #e8e8f0;
  --muted: #7a7a9a;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 10% 20%, rgba(124,109,250,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 90% 80%, rgba(250,109,159,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(109,250,192,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
}

.breadcrumb .sep {
  opacity: 0.4;
}

.breadcrumb .active {
  color: var(--text);
}

/* APP */
.app {
  position: relative;
  z-index: 1;
}

/* STEPS NAV */
.steps-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}

.step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}

.step-tab.active {
  color: var(--accent);
  border-color: var(--accent);
}

.step-tab.done {
  color: var(--text);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface3);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-tab.active .step-num {
  background: var(--accent);
  color: white;
}

.step-tab.done .step-num {
  background: var(--accent3);
  color: #0a0a0f;
}

/* SECTIONS */
.section {
  display: none;
  padding: 32px 24px;
  animation: fadeIn .3s ease;
}

.section.active {
  display: block;
}

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

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.section-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* CATEGORY GRID */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.cat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cat-color, var(--accent));
  opacity: 0;
  transition: opacity .2s;
}

.cat-card:hover::before {
  opacity: 0.06;
}

.cat-card.selected {
  border-color: var(--cat-color, var(--accent));
}

.cat-card.selected::before {
  opacity: 0.10;
}

.cat-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.cat-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.cat-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.cat-count {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  background: var(--surface3);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
}

/* TITLE SECTION */
.title-section {
  max-width: 600px;
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.input-field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: border-color .2s;
  outline: none;
  resize: none;
}

.input-field:focus {
  border-color: var(--accent);
}

.input-field::placeholder {
  color: var(--muted);
}

.char-count {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

/* FRAMEWORK GRID */
.fw-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.fw-filter {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  background: var(--surface);
  color: var(--muted);
}

.fw-filter.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.fw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.fw-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all .2s;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.fw-card:hover {
  border-color: var(--fw-color, var(--accent));
  transform: translateY(-2px);
}

.fw-card.selected {
  border-color: var(--fw-color, var(--accent));
  background: linear-gradient(135deg, var(--surface) 0%, rgba(124,109,250,0.08) 100%);
}

.fw-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fw-color, var(--accent));
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.fw-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 8px;
  background: rgba(124,109,250,0.15);
  color: var(--accent);
}

.tag-ps {
  background: rgba(124,109,250,0.15);
  color: #a99cfc;
}

.tag-im {
  background: rgba(109,250,192,0.12);
  color: #6dfac0;
}

.tag-cr {
  background: rgba(250,192,109,0.12);
  color: #fac06d;
}

.tag-de {
  background: rgba(250,109,159,0.12);
  color: #fa6d9f;
}

.tag-st {
  background: rgba(109,192,250,0.12);
  color: #6dc0fa;
}

.fw-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.fw-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.fw-steps {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fw-step-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface3);
  color: var(--muted);
}

/* WORKSPACE */
.workspace {
  display: flex;
  gap: 20px;
}

.fw-panel {
  flex: 1;
  min-width: 0;
}

.fw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.fw-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.fw-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.fw-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(124,109,250,0.15);
  color: var(--accent);
  flex-shrink: 0;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}

.step-card.active {
  border-color: var(--accent);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
}

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 13px;
  transition: all .2s;
}

.step-card.active .step-indicator {
  background: var(--accent);
  color: white;
}

.step-card.completed .step-indicator {
  background: var(--accent3);
  color: #0a0a0f;
}

.step-info {
  flex: 1;
}

.step-label {
  font-weight: 600;
  font-size: 14px;
}

.step-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.step-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: none;
}

.step-card.active .step-body {
  display: block;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.sidebar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.activity-info {
  font-size: 13px;
}

.activity-info .label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.activity-info .value {
  font-weight: 500;
  margin-bottom: 10px;
}

.active-fws {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-fw-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface2);
  font-size: 13px;
}

.active-fw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.active-fw-name {
  font-weight: 500;
  flex: 1;
}

.remove-fw {
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  transition: color .2s;
}

.remove-fw:hover {
  color: var(--accent2);
}

.progress-bar {
  background: var(--surface3);
  border-radius: 4px;
  height: 6px;
  margin: 8px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  transition: width .3s;
}

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

/* FOLLOWUP */
.followup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.followup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
}

.followup-card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.followup-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.followup-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.followup-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* BUTTONS */
.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #9585fc;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124,109,250,0.3);
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text);
}

.btn-success {
  background: var(--accent3);
  color: #0a0a0f;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(109,250,192,0.25);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  align-items: center;
}

/* RESULT */
.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.result-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 16px;
}

.result-fw {
  margin-bottom: 24px;
}

.result-fw-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-step {
  padding: 12px 16px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 13px;
  border-left: 3px solid var(--accent);
}

.result-step .rs-label {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 4px;
}

.result-step .rs-content {
  color: var(--text);
  line-height: 1.5;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* EMPTY */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-text {
  font-size: 14px;
}

/* NOTE INFO */
.note-info {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface3);
  border-radius: 8px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s;
}

.toast.show {
  transform: none;
  opacity: 1;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

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

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

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}