body { margin: 0; font-family: Arial; }
#versionInfo {
    position: fixed;
    bottom: 0;
    right: 0;
    font-size: 10px;
    color: gray;
    background: rgba(255, 255, 255, 0.85);
    padding: 0px 10px;
    border-top-left-radius: 6px;
    border: 1px solid #ccc;
    border-right: none;
    border-bottom: none;
    z-index: 1000;
    cursor: pointer;
}
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: opacity 0.4s ease-in-out;
}

#loadingScreen.opacity-0 {
    opacity: 0;
    pointer-events: none;
}

#container { 
    width: 100vw; 
    height: calc(100vh - 56px); 
    background: #f0f0f0; 
    position: relative; 
    touch-action: none;
}
#container canvas {
  pointer-events: auto;
}
#tooltip {
    position: fixed;
    z-index: 1000;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
    pointer-events: none;
    white-space: pre-line;
}
#minimap {
    position: absolute;
    top: 70px;
    right: 30px;
    width: 200px;
    height: 120px;
    background: #eee;
    border: 1px solid #999;
    overflow: hidden;
    z-index: 10;
    pointer-events: all;
    cursor: pointer;
}
#sizeDisplay {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 13px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 999;
    display: none;
}
#sidePanel {
    position: absolute;
    top: 200px;
    right: 30px;
    width: 200px;
    height: calc(100vh - 200px - 20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    z-index: 999;
    pointer-events: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#sidePanel .product-tile.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#productTileList {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

#filterBar {
    padding: 6px;
    border-bottom: 1px solid #ccc;
    background: #fff;
}

#groupFilterInput {
    width: 100%;
    padding: 4px;
    font-size: 13px;
    box-sizing: border-box;
    text-transform: uppercase;
}

.needs-toggle {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-top: 4px;
    gap: 4px;
}

.needs-toggle input[type="checkbox"] {
    margin: 0;
}

.product-tile {
    position: relative;
    cursor: grab;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px;
    background-color: #fff;
    margin-bottom: 6px;
    font-size: 11px;
    overflow: hidden;
}

.product-tile.highlight-undisplayed {
    background-color: #fffea9 !important;
} 

.product-tile.needs-placement::after {
    content: "📍";
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 14px;
    color: #d9534f;
    pointer-events: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    #printArea, #printArea * {
        visibility: visible !important;
    }

    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: white;
    }

    #container {
        width: 100vw !important;
        height: auto !important;
    }

    canvas {
        max-width: 100%;
        height: auto !important;
    }

    nav, #sidePanel, #tooltip, #minimap, #sizeDisplay, #loadingScreen, .btn {
        display: none !important;
    }

    @page {
        size: A3 landscape; /* or A4 landscape */
        margin: 10mm;
    }
}