/* Floor Forge uses the shared Lakshan DevStudio palette: cream light mode and a re-themed dark mode. */
:root {
  color-scheme: light;
  --bg: #f3ecdf; --surface: #fffaf0; --surface-2: #f8f0e2; --ink: #27312e;
  --muted: #6f7771; --line: #d8d0c2; --line-strong: #bdb4a6; --accent: #2f8f72;
  --accent-strong: #1f6d56; --accent-soft: #d8efe5; --blue: #3478b8; --blue-soft: #e1eef9;
  --red: #c94a51; --red-soft: #fae5e5; --green: #2e8b62; --green-soft: #def1e7;
  --shadow: 0 16px 40px rgba(67, 57, 42, .10); --radius: 16px; --tile: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html.dark {
  color-scheme: dark;
  --bg: #17201e; --surface: #202b28; --surface-2: #26332f; --ink: #f3eadb;
  --muted: #aeb9b3; --line: #384843; --line-strong: #51635d; --accent: #77c5a8;
  --accent-strong: #9dd9c2; --accent-soft: #25453b; --blue: #78afe1; --blue-soft: #263f55;
  --red: #ef7a80; --red-soft: #4d2b2e; --green: #77c79f; --green-soft: #25483a;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { min-width: 1020px; }
button, input, select { font: inherit; color: inherit; }
button, select, input { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; }
button { cursor: pointer; padding: 9px 12px; font-weight: 700; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.app-shell { min-height: 100vh; display: grid; grid-template-rows: 66px 1fr; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: #10261f; font-weight: 900; letter-spacing: -.06em; }
.brand span:last-child { display: grid; } .brand strong { letter-spacing: -.02em; } .brand small { color: var(--muted); font-size: 11px; }
.header-actions, .button-row, .zoom-controls, .section-heading { display: flex; align-items: center; gap: 8px; }
.status { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-blue { color: var(--blue); background: var(--blue-soft); }
.status-green { color: var(--green); background: var(--green-soft); }
.status-red { color: var(--red); background: var(--red-soft); }
.select-wrap select { padding: 8px 30px 8px 10px; }
.workspace { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 220px minmax(570px, 1fr) 310px; gap: 12px; padding: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.left-sidebar { padding: 15px; display: flex; flex-direction: column; gap: 18px; overflow: auto; }
.left-sidebar section + section { padding-top: 17px; border-top: 1px solid var(--line); }
.eyebrow { margin: 0 0 9px; text-transform: uppercase; font-size: 10px; letter-spacing: .14em; font-weight: 900; color: var(--muted); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-button { min-height: 38px; background: var(--surface-2); }
.tool-button.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.hint, .microcopy { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 8px 0 0; }
.section-heading { justify-content: space-between; align-items: flex-start; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.section-heading h2 { font-size: 16px; margin: 2px 0 0; }
.layer-list { display: grid; gap: 7px; }
.layer-row { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.layer-row.is-active { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.layer-row button { padding: 5px; border: 0; background: transparent; min-width: 26px; }
.layer-name { text-align: left; font-size: 12px; }
.selection-card { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.selection-card p { margin: 0; font-size: 12px; line-height: 1.35; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.check-row input { accent-color: var(--accent); }
.danger-button { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.field { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.field input { min-width: 0; width: 100%; padding: 9px; background: var(--surface-2); }
.project-actions { margin-top: auto; display: grid; gap: 8px; }
.button-row > * { flex: 1; }
.primary-button { background: var(--accent); color: #10261f; border-color: transparent; }
.quiet-button { width: 100%; background: transparent; }
.canvas-stage { min-width: 0; display: grid; grid-template-rows: 48px minmax(0, 1fr) 24px; gap: 8px; }
.canvas-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; box-shadow: none; }
.canvas-toolbar > div:first-child { display: grid; gap: 2px; }
.canvas-toolbar strong { font-size: 12px; } .canvas-toolbar span { color: var(--muted); font-size: 10px; }
.zoom-controls button { min-width: 32px; padding: 5px 8px; }
.zoom-controls output { min-width: 42px; text-align: center; font-size: 11px; font-weight: 800; }
.canvas-scroller { min-height: 430px; overflow: auto; display: grid; place-items: center; padding: 54px; border-radius: var(--radius); background-color: #b8ae9d; background-image: linear-gradient(45deg, rgba(255,255,255,.12) 25%, transparent 25%),linear-gradient(-45deg, rgba(255,255,255,.12) 25%, transparent 25%),linear-gradient(45deg, transparent 75%, rgba(255,255,255,.12) 75%),linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.12) 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
html.dark .canvas-scroller { background-color: #111917; }
#floor-canvas { display: block; image-rendering: pixelated; background: #e7dece; box-shadow: 0 12px 36px rgba(0,0,0,.25); touch-action: none; cursor: crosshair; }
.legend { display: flex; gap: 14px; justify-content: center; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 8px; border-radius: 2px; } .collision-key { background: repeating-linear-gradient(45deg,var(--red),var(--red) 2px,transparent 2px,transparent 4px); border: 1px solid var(--red); } .selection-key { border: 2px solid var(--blue); }
.right-sidebar { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.integration-panel { padding: 14px; box-shadow: none; }
.mount-point { min-height: 180px; margin-top: 12px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-2); }
.mount-placeholder { min-height: 180px; display: grid; place-content: center; gap: 5px; padding: 18px; text-align: center; color: var(--muted); }
.mount-placeholder strong { color: var(--ink); font-size: 12px; } .mount-placeholder span { font-size: 11px; line-height: 1.5; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; }
.toast { max-width: 320px; padding: 11px 14px; border-radius: 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 1180px) { .workspace { grid-template-columns: 205px minmax(540px,1fr) 270px; } }
@media (prefers-reduced-motion: no-preference) { button, .layer-row { transition: background-color .15s, border-color .15s, transform .15s; } button:active:not(:disabled) { transform: translateY(1px); } }
/* Narrow screens keep every control available in a single-column inspection layout. */
@media (max-width: 800px) {
  body { min-width: 0; }
  .app-shell { grid-template-rows: auto 1fr; }
  .topbar { min-height: 66px; padding: 10px 12px; gap: 8px; }
  .brand small, #save-status { display: none; }
  .workspace { min-height: auto; grid-template-columns: 1fr; padding: 8px; }
  .left-sidebar { order: 1; }
  .canvas-stage { order: 2; min-height: 620px; }
  .right-sidebar { order: 3; }
  .canvas-scroller { min-height: 520px; place-items: start; padding: 28px; }
  .left-sidebar, .right-sidebar { overflow: visible; }
}

/* ---- Merge additions (assets + export half) -------------------------------- */
/* The mounted modules keep their own headings inside A's section headings;
   hide B's duplicate top-level h2 ("Atlases" / "Export") only. */
.ff-panel > h2 { display: none; }
/* Mounted panels sit inside A's .integration-panel cards: drop the extra
   card chrome (border/shadow/background) so they read as content, not
   nested cards. The .ff-panel colours still resolve for wells and pills. */
.integration-panel .ff-panel { border: 0; padding: 0; margin-bottom: 0; background: transparent; box-shadow: none; }
/* With the assets + export panels mounted, the right sidebar is much taller
   than the stage; keep the canvas pinned to the TOP of the scroller so it is
   never centred below the fold. */
.canvas-scroller { place-items: start center; }
