@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --pink: #0D47A1;
  --blue: #1565C0;
  --orange: #1976D2;
  --yellow: #42A5F5;
  --dark: #E3F2FD;
  --dark-light: #34495E;
  --bg: #FDF8F5;
  --card: #FFFFFF;
  --border: #E8DED5;
  --text: #2C3E50;
  --text-muted: #7F8C8D;
  --shadow-sm: 0 1px 3px rgba(44,62,80,0.06);
  --shadow-md: 0 4px 12px rgba(44,62,80,0.08);
  --shadow-lg: 0 8px 24px rgba(44,62,80,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

::selection {
  background: var(--pink);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(44,62,80,0.15);
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.6rem;
}

.app-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.app-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229,93,135,0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--dark);
}

.btn-back {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255,255,255,0.2);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: rgba(44,62,80,0.06);
}

.btn-icon-danger:hover {
  background: rgba(229,93,135,0.1);
}

.btn-add {
  background: var(--blue);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-add:hover {
  background: var(--dark);
  transform: scale(1.05);
}

.btn-add:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-remove:hover {
  background: rgba(229,93,135,0.1);
  color: var(--pink);
}

.btn-move {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-move:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== SKELETON LOADING ===== */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.skeleton-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.skeleton-line {
  background: linear-gradient(90deg, var(--border) 25%, #f0ebe5 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton-title { height: 20px; width: 60%; }
.skeleton-desc { height: 14px; width: 90%; }
.skeleton-short { height: 14px; width: 40%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 24px;
  font-size: 0.95rem;
}

.empty-section {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  padding: 12px 0;
}

/* ===== PROJECT GRID ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
  animation: fadeInUp 0.4s ease both;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blue);
}

.card-image {
  height: 160px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.project-card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 16px 20px 20px;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink);
  margin-bottom: 6px;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stat {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-icon {
  font-size: 0.85rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cost-badge {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: var(--dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 20px;
}

.card-actions {
  display: flex;
  gap: 2px;
}

/* ===== FORM ===== */
.form-container {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: fadeInUp 0.35s ease both;
}

.form-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--dark);
  margin-bottom: 10px;
}

.form-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-chip {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark-light);
}

.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--bg);
}

.form-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.form-tab.active {
  color: var(--pink);
}

.form-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  border-radius: 2px 2px 0 0;
}

.form-body {
  padding: 24px;
}

.form-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg);
}

/* ===== FIELDS ===== */
.field {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dark-light);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95,195,228,0.15);
}

.field-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95,195,228,0.15);
}

.field-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s;
}

.field-select:focus {
  outline: none;
  border-color: var(--blue);
}

.field-small {
  width: 80px;
  flex-shrink: 0;
}

.flex-grow {
  flex: 1;
  min-width: 0;
}

.cover-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.upload-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--dark-light);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-btn:hover {
  border-color: var(--blue);
  background: rgba(95,195,228,0.05);
}

/* ===== MATERIAL EDITOR ===== */
.editor-section {
  /* wrapper */
}

.add-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.material-add-row {
  flex-wrap: wrap;
}

.cost-input-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.cost-prefix {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

.cost-field {
  padding-left: 22px;
}

.material-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s;
  animation: fadeInUp 0.3s ease both;
}

.material-item:hover {
  border-color: var(--border);
  background: var(--card);
}

.material-info {
  flex: 1;
  min-width: 0;
}

.material-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.material-qty {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.material-cost-area {
  text-align: right;
  flex-shrink: 0;
}

.material-unit-cost {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.material-total {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--orange);
}

.total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--dark);
  color: white;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-weight: 500;
}

.total-amount {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--yellow);
}

/* ===== STEP EDITOR ===== */
.step-add-row {
  flex-direction: column;
}

.step-add-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.time-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.time-suffix {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--blue);
  animation: fadeInUp 0.3s ease both;
  transition: background 0.2s;
}

.step-item:hover {
  background: var(--card);
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-instruction {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.step-photo {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

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

.step-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.step-photo-btn {
  font-size: 0.78rem;
  color: var(--blue);
  cursor: pointer;
  transition: color 0.15s;
}

.step-photo-btn:hover {
  color: var(--pink);
}

.step-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* ===== PROJECT DETAIL ===== */
.detail-container {
  animation: fadeInUp 0.35s ease both;
}

.detail-hero {
  position: relative;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 20px;
  background: linear-gradient(transparent, rgba(44,62,80,0.85));
  color: white;
}

.detail-hero-overlay .detail-category {
  color: var(--yellow);
}

.detail-hero-overlay .detail-title {
  color: white;
}

.detail-header-plain {
  margin-bottom: 20px;
}

.detail-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink);
  margin-bottom: 4px;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--dark);
  line-height: 1.2;
}

.detail-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.detail-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.detail-stat-value {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dark);
}

.detail-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.detail-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--dark-light);
}

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

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--dark);
}

.section-badge {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: var(--dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
}

.detail-material-list {
  display: flex;
  flex-direction: column;
}

.detail-material {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeInUp 0.3s ease both;
}

.detail-material:last-child {
  border-bottom: none;
}

.dm-name {
  font-weight: 500;
  font-size: 0.9rem;
  flex: 1;
}

.dm-qty {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 16px;
  flex-shrink: 0;
}

.dm-cost {
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
  position: relative;
  height: 24px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  border-radius: 12px;
  transition: width 0.4s ease;
  min-width: 0;
}

.progress-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--dark);
}

/* ===== DETAIL STEPS ===== */
.detail-step-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-step {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid var(--blue);
  animation: fadeInUp 0.3s ease both;
}

.detail-step:hover {
  background: rgba(95,195,228,0.06);
}

.detail-step.step-done {
  border-left-color: var(--orange);
  opacity: 0.7;
}

.detail-step.step-done .ds-instruction {
  text-decoration: line-through;
  color: var(--text-muted);
}

.ds-check {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ds-number {
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.ds-body {
  flex: 1;
  min-width: 0;
}

.ds-instruction {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.ds-photo {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.ds-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-footer-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
}

/* ===== FADE IN ===== */
.fade-in {
  animation: fadeInUp 0.25s ease both;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-main {
    padding: 16px;
  }

  .header-content {
    padding: 12px 16px;
  }

  .app-title {
    font-size: 1.15rem;
  }

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

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

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

  .detail-hero {
    height: 180px;
  }

  .detail-title {
    font-size: 1.4rem;
  }

  .material-add-row {
    flex-wrap: wrap;
  }

  .material-add-row .field-input.flex-grow {
    width: 100%;
    flex: none;
  }

  .form-tabs {
    padding: 0 12px;
    overflow-x: auto;
  }

  .form-body {
    padding: 16px;
  }

  .form-header {
    padding: 16px 16px 12px;
  }

  .detail-section {
    padding: 16px;
  }

  .add-row {
    flex-wrap: wrap;
  }

  .field-small {
    width: 60px;
  }

  .step-actions {
    flex-direction: row;
  }
}

@media (max-width: 380px) {
  .detail-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .detail-stat {
    padding: 10px 8px;
  }

  .detail-stat-value {
    font-size: 0.95rem;
  }
}


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to DIY Planner! This is your project dashboard where all your DIY projects live.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Tap 'New Project' to start planning your first DIY project.", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Fill in the project details — title, description, category, and optionally upload a cover photo.", "view": "user", "highlight_selector": ".section-content", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Switch to the Materials tab to add your material list with quantities and costs. The total is calculated automatically.", "view": "user", "highlight_selector": ".form-tab:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Add each material with its name, quantity, unit, and cost per unit.", "view": "user", "highlight_selector": ".material-add-row", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Switch to Steps to add step-by-step instructions. You can upload photos for each step and reorder them.", "view": "user", "highlight_selector": ".form-tab:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "Once saved, tap any project card to view the full details with a progress tracker.", "view": "user", "highlight_selector": ".project-card", "wait_for": "user_interaction"},
  {"step": 8, "narration": "In the detail view, tap each step to mark it complete and track your progress as you build!", "view": "user", "highlight_selector": ".detail-step", "wait_for": "tap_to_continue"}
]
-->

.auth-gate {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-photo-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.progress-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-photo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-photo-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.progress-photo-preview {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: #f2ede8;
}

.progress-photo-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-photo-actions {
  display: flex;
  align-items: flex-start;
}

.progress-photo-card {
  margin-top: 12px;
}

.detail-progress-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.detail-progress-photo {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.detail-progress-photo img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.detail-progress-photo-body {
  padding: 10px 12px;
}

.detail-progress-photo-title {
  font-weight: 700;
  color: var(--dark);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.detail-progress-photo-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.detail-progress-photo-date {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .progress-photo-item {
    grid-template-columns: 1fr;
  }

  .progress-photo-preview {
    width: 100%;
    height: 180px;
  }
}

.step-item.step-complete {
  border-left-color: var(--orange);
  background: rgba(255, 210, 0, 0.08);
}

.step-item.step-complete .step-instruction {
  text-decoration: line-through;
  color: var(--text-muted);
}

.step-check {
  border: none;
  cursor: pointer;
}

.step-check:hover {
  transform: scale(1.04);
}

.step-check:focus {
  outline: none;
}

.step-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
}

.step-status-complete {
  background: rgba(247, 151, 30, 0.14);
  color: var(--orange);
}

.step-status-pending {
  background: rgba(95, 195, 228, 0.12);
  color: var(--blue);
}

.rich-text-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rich-text-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rich-text-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(95, 195, 228, 0.06);
}

.rich-text-area {
  min-height: 96px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  outline: none;
}

.rich-text-area:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95,195,228,0.15);
}

.rich-text-area.is-empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.rich-text-render p {
  margin-bottom: 0.65em;
}

.rich-text-render p:last-child,
.rich-text-render ul:last-child,
.rich-text-render ol:last-child,
.rich-text-render blockquote:last-child,
.rich-text-render pre:last-child {
  margin-bottom: 0;
}

.rich-text-render ul,
.rich-text-render ol {
  padding-left: 1.25rem;
  margin: 0.35rem 0 0.65rem;
}

.rich-text-render blockquote {
  margin: 0.5rem 0;
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--blue);
  background: rgba(95,195,228,0.06);
  border-radius: 0 8px 8px 0;
}

.rich-text-render pre {
  white-space: pre-wrap;
  background: rgba(44,62,80,0.06);
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  overflow-x: auto;
}

.rich-text-render code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

.step-instruction.rich-text-render {
  white-space: normal;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.tutorial-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tutorial-status-draft {
  background: rgba(127, 140, 141, 0.12);
  color: var(--text-muted);
}

.tutorial-status-published {
  background: rgba(95, 195, 228, 0.12);
  color: var(--blue);
}

.tutorial-status-finished {
  background: rgba(247, 151, 30, 0.14);
  color: var(--orange);
}

.btn-icon-primary:hover {
  background: rgba(95, 195, 228, 0.12);
}

.btn-icon-success:hover {
  background: rgba(247, 151, 30, 0.12);
}

.tutorial-share-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(95, 195, 228, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(95, 195, 228, 0.06);
  color: var(--dark-light);
  font-size: 0.9rem;
}

.tutorial-share-copy {
  margin-top: 4px;
  font-weight: 600;
  color: var(--blue);
}

.project-pdf-report {
  position: relative;
  width: 794px;
  max-width: 794px;
  padding: 24px;
  background: #ffffff;
  color: #2C3E50;
  font-family: 'Plus Jakarta Sans', sans-serif;
  opacity: 0;
  pointer-events: none;
  height: auto;
  overflow: visible;
}

.pdf-report-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin-bottom: 8px;
  color: #2C3E50;
}

.pdf-report-header p {
  font-size: 13px;
  color: #34495E;
  margin-bottom: 12px;
}

.pdf-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: #7F8C8D;
}

.pdf-report-section {
  margin-top: 20px;
}

.pdf-report-section h2 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #2C3E50;
}

.pdf-cover-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pdf-table th,
.pdf-table td {
  border: 1px solid #E8DED5;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.pdf-table th {
  background: #FDF8F5;
  font-weight: 700;
}

.pdf-empty {
  font-size: 12px;
  color: #7F8C8D;
}

.pdf-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-step-item {
  display: flex;
  gap: 10px;
  border: 1px solid #E8DED5;
  border-radius: 10px;
  padding: 10px 12px;
}

.pdf-step-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #5FC3E4;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.pdf-step-body {
  flex: 1;
  min-width: 0;
}

.pdf-step-text {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.pdf-step-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #7F8C8D;
}

@media (max-width: 640px) {
  .project-pdf-report {
    width: 100%;
    max-width: 100%;
  }
}

.ai-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ai-helper-text {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.ai-success-note {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
}

.ai-error {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--pink);
}

.step-progress-meter {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.step-progress-meter-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  border-radius: inherit;
  transition: width 0.3s ease;
}
