/* Workshop Layout Optimizer — styles */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-alt: #f3efe8;
  --text: #2c2418;
  --text-muted: #6b5e4f;
  --text-light: #9a8b7a;
  --accent: #b45a28;
  --accent-hover: #9a4a1e;
  --accent-light: #fff0e6;
  --border: #e0d8cc;
  --border-dark: #c4b8a6;
  --success: #3a7d44;
  --warning: #c4881a;
  --danger: #c0392b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, Consolas, monospace;
  --max-width: 1200px;
  --header-h: 60px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

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; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--accent); }
.logo svg { color: var(--accent); flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 20px;
}
.main-nav a {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #3d2e1a 0%, #5a3d22 50%, #7a5230 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; opacity: .85; margin-bottom: 28px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s ease;
  font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* Planner Section */
.planner-section { padding: 40px 20px; }
.planner-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}

.controls-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
}
.controls-panel h2 { font-size: 1.2rem; margin-bottom: 16px; }
.controls-panel h3 { font-size: 1rem; margin-bottom: 10px; }

.control-group { margin-bottom: 14px; }
.control-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.control-group input[type="number"],
.control-group input[type="text"],
.control-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}
.control-group input:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.tool-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: .82rem;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text);
  transition: all .12s ease;
}
.chip:hover { border-color: var(--accent); background: var(--accent-light); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.inline-input { display: flex; gap: 6px; }
.inline-input input { flex: 1; }

.active-tools-list { margin-top: 10px; min-height: 20px; }
.active-tool-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-light);
  border-radius: 16px;
  font-size: .82rem;
  margin: 3px 4px 3px 0;
  color: var(--accent-hover);
  font-weight: 500;
}
.active-tool-tag button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--accent);
  padding: 0;
  font-family: var(--font);
}
.active-tool-tag button:hover { color: var(--danger); }

.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-group label { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 400; cursor: pointer; color: var(--text); }
.radio-group input[type="radio"] { accent-color: var(--accent); }

.action-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.action-row .btn { flex: 1; min-width: 0; }
.secondary-actions { margin-top: 10px; }
.secondary-actions .btn { flex: 1; }

/* Preview Panel */
.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  min-height: 500px;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.preview-header h2 { font-size: 1.2rem; }
.plan-dims { font-size: .85rem; color: var(--text-muted); font-weight: 500; }

.floor-plan {
  background: #f5f0e8;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.floor-plan .empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-light);
  text-align: center;
  padding: 20px;
}
.floor-plan .empty-state svg { opacity: .4; }
.floor-plan .empty-state p { max-width: 280px; font-size: .95rem; }

/* Floor plan items */
.fp-item {
  position: absolute;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
  padding: 4px;
  cursor: grab;
  user-select: none;
  line-height: 1.2;
  border: 2px solid transparent;
  transition: box-shadow .12s ease;
  overflow: hidden;
}
.fp-item:hover { box-shadow: var(--shadow-lg); z-index: 10; }
.fp-item.dragging { cursor: grabbing; opacity: .85; z-index: 20; }

.fp-zone-label {
  position: absolute;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .5;
  pointer-events: none;
  padding: 4px 8px;
}

.fp-grid-line-h,
.fp-grid-line-v {
  position: absolute;
  background: rgba(0,0,0,.04);
  pointer-events: none;
}
.fp-grid-line-h { height: 1px; left: 0; right: 0; }
.fp-grid-line-v { width: 1px; top: 0; bottom: 0; }

/* Zone colors */
.zone-cutting { background: #f2c94c33; border-color: #f2c94c55; }
.zone-assembly { background: #27ae6033; border-color: #27ae6055; }
.zone-finishing { background: #8e44ad33; border-color: #8e44ad55; }
.zone-storage { background: #2980b933; border-color: #2980b955; }
.zone-walkway { background: #ecf0f133; border-color: #bdc3c755; border-style: dashed; }

.fp-item.zone-cutting { background: #f2c94c55; border-color: #f2c94c; }
.fp-item.zone-assembly { background: #27ae6055; border-color: #27ae60; }
.fp-item.zone-finishing { background: #8e44ad55; border-color: #8e44ad; }
.fp-item.zone-storage { background: #2980b955; border-color: #2980b9; }

.zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-muted);
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid;
}
.legend-swatch.cutting { background: #f2c94c55; border-color: #f2c94c; }
.legend-swatch.assembly { background: #27ae6055; border-color: #27ae60; }
.legend-swatch.finishing { background: #8e44ad55; border-color: #8e44ad; }
.legend-swatch.storage { background: #2980b955; border-color: #2980b9; }

.layout-notes {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.layout-notes strong { color: var(--text); }
.layout-notes .warning { color: var(--warning); }
.layout-notes .good { color: var(--success); }

/* Guide Section */
.guide-section { padding: 48px 20px; background: var(--surface); }
.guide-inner { max-width: var(--max-width); margin: 0 auto; }
.guide-inner h2 { font-size: 1.6rem; text-align: center; margin-bottom: 32px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.guide-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.guide-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 12px;
}
.guide-card h3 { font-size: 1rem; margin-bottom: 8px; }
.guide-card p { font-size: .88rem; color: var(--text-muted); line-height: 1.5; }

/* Examples Section */
.examples-section { padding: 48px 20px; }
.examples-inner { max-width: var(--max-width); margin: 0 auto; }
.examples-inner h2 { font-size: 1.6rem; text-align: center; margin-bottom: 32px; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.scenario-card h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--accent); }
.scenario-card p { font-size: .9rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.55; }
.scenario-tip {
  font-size: .85rem;
  color: var(--text);
  background: var(--accent-light);
  padding: 10px 14px;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

/* Mistakes Section */
.mistakes-section { padding: 48px 20px; background: var(--surface); }
.mistakes-inner { max-width: var(--max-width); margin: 0 auto; }
.mistakes-inner h2 { font-size: 1.6rem; text-align: center; margin-bottom: 28px; }
.mistakes-list { list-style: none; display: grid; gap: 14px; }
.mistakes-list li {
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.mistakes-list li strong { color: var(--text); }

/* FAQ Section */
.faq-section { padding: 48px 20px; }
.faq-inner { max-width: 760px; margin: 0 auto; }
.faq-inner h2 { font-size: 1.6rem; text-align: center; margin-bottom: 28px; }
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
details summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; font-size: 1.2rem; color: var(--accent); }
details[open] summary::after { content: '−'; }
details summary:hover { background: var(--surface-alt); }
details p {
  padding: 0 20px 16px;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 20px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-size: .95rem; }
.footer-brand span { font-size: .82rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-note { font-size: .78rem; color: var(--text-light); width: 100%; text-align: center; margin-top: 8px; }

/* Responsive */
@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .controls-panel { position: static; max-height: none; }
  .floor-plan { aspect-ratio: 3 / 4; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .hero { padding: 40px 16px; }
  .main-nav { gap: 12px; }
  .main-nav a { font-size: .82rem; }
  .logo span { font-size: .95rem; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .action-row .btn { flex: 1 1 100%; }
  .secondary-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 400px) {
  .guide-grid { grid-template-columns: 1fr; }
  .tool-presets { gap: 4px; }
  .chip { font-size: .78rem; padding: 4px 10px; }
}

/* Print */
@media print {
  .site-header, .site-footer, .controls-panel, .hero, .guide-section, .examples-section, .mistakes-section, .faq-section { display: none; }
  .planner-section { padding: 0; }
  .preview-panel { box-shadow: none; border: none; padding: 0; }
  .floor-plan { border: 2px solid #000; }
  .preview-header { margin-bottom: 8px; }
}

/* Scrollbar */
.controls-panel::-webkit-scrollbar { width: 6px; }
.controls-panel::-webkit-scrollbar-track { background: transparent; }
.controls-panel::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

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



/* 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;
}
