/* MiniForge - Miniature Painting Progress Gallery */
:root {
  --bg: #1a1a2e;
  --bg-panel: #16213e;
  --bg-card: #0f3460;
  --bg-input: #1a1a2e;
  --text: #e0e0e0;
  --text-muted: #8892a4;
  --text-heading: #f0f0f0;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --accent-glow: rgba(233,69,96,0.15);
  --warm: #f5a623;
  --warm-glow: rgba(245,166,35,0.12);
  --success: #4caf50;
  --border: #2a3a5c;
  --border-light: #3a4a6c;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* Header */
.site-header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1.25rem;
}
.logo-icon { color: var(--accent); }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { color: var(--text-muted); font-size: 0.9rem; }
.main-nav a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  color: var(--text);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost {
  border-color: var(--border-light);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-danger { border-color: #c0392b; color: #c0392b; }
.btn-danger:hover { background: #c0392b; color: #fff; }

/* Hero */
.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  color: var(--text-heading);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 500px;
}
.hero-visual { display: flex; justify-content: center; }
.mini-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.mini-stage-label {
  padding: 1.5rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border-light);
}

/* Workspace */
.workspace {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}
.workspace-layout {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 1rem;
  min-height: 500px;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.panel-header h2 { font-size: 1rem; color: var(--text-heading); }
.panel-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

/* Project List */
.project-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.project-item {
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}
.project-item:hover { background: var(--accent-glow); border-color: var(--border-light); }
.project-item.active { background: var(--accent-glow); border-color: var(--accent); }
.project-item-name { font-weight: 600; font-size: 0.9rem; color: var(--text-heading); }
.project-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Gallery */
.gallery-title-block { display: flex; flex-direction: column; gap: 0.2rem; }
.gallery-meta { font-size: 0.8rem; color: var(--text-muted); }
.gallery-actions { display: flex; gap: 0.5rem; }
.gallery-grid {
  flex: 1;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  align-content: start;
  overflow-y: auto;
}

/* Stage Card */
.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.stage-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.stage-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.stage-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bg); }
.stage-card-body { padding: 0.75rem; }
.stage-card-label { font-weight: 600; font-size: 0.85rem; color: var(--text-heading); }
.stage-card-paints { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.stage-card-order {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Recipe Panel */
.recipe-content { flex: 1; padding: 1rem; overflow-y: auto; }
.recipe-stage-name { font-size: 1.1rem; font-weight: 700; color: var(--text-heading); margin-bottom: 0.5rem; }
.recipe-section { margin-bottom: 1rem; }
.recipe-section h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.4rem; }
.recipe-paint-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.recipe-paint-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text);
}
.recipe-notes { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; white-space: pre-wrap; }

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  gap: 0.75rem;
}
.empty-state svg { opacity: 0.4; }
.empty-state p { font-size: 0.9rem; max-width: 280px; }

/* Guide Section */
.guide-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.guide-section h2 { font-size: 1.5rem; color: var(--text-heading); margin-bottom: 1.5rem; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.guide-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.guide-card h3 { font-size: 1rem; color: var(--accent); margin-bottom: 0.5rem; }
.guide-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* Assumptions */
.assumptions-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}
.assumptions-inner {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.assumptions-inner h2 { font-size: 1.2rem; color: var(--text-heading); margin-bottom: 1rem; }
.assumptions-list { list-style: none; display: grid; gap: 0.5rem; }
.assumptions-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
}
.assumptions-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  background: var(--warm);
  border-radius: 50%;
}
.version-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.2rem; }
.footer-brand .logo-text { font-weight: 700; color: var(--text-heading); }
.footer-tag { font-size: 0.8rem; color: var(--text-muted); }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { font-size: 0.85rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}
.modal-wide { max-width: 800px; }
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; color: var(--text-heading); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Form Elements */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Paint Input */
.paint-input-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.paint-input-row input { flex: 1; }
.paint-input-row .btn { padding: 0.4rem 0.6rem; }
.paint-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.paint-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.8rem;
}
.paint-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.paint-chip-remove:hover { color: var(--accent); }

/* Photo Upload */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.photo-upload-area:hover { border-color: var(--accent); background: var(--accent-glow); }
.photo-upload-area.has-image { padding: 0; border-style: solid; }
.photo-upload-area img { width: 100%; max-height: 200px; object-fit: contain; display: block; border-radius: var(--radius); }
.photo-upload-placeholder { color: var(--text-muted); font-size: 0.85rem; }

/* Strip Preview */
.strip-actions { display: flex; gap: 0.75rem; margin-top: 1rem; justify-content: center; }
#strip-canvas { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 1024px) {
  .workspace-layout { grid-template-columns: 220px 1fr; }
  .panel-recipe { grid-column: 1 / -1; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 2rem 1rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero-sub { margin: 0 auto 1.5rem; }
  .hero-visual { display: none; }
  .workspace-layout { grid-template-columns: 1fr; }
  .panel-projects { max-height: 200px; }
  .guide-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0.5rem 1rem; }
  .main-nav { gap: 1rem; }
  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-actions { flex-wrap: wrap; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus styles */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Print */
@media print {
  .site-header, .site-footer, .panel-projects, .gallery-actions, .panel-recipe .panel-footer { display: none; }
  .workspace-layout { display: block; }
  .panel { border: none; }
  body { background: #fff; color: #000; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
