.lbr-container {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    max-width: 1200px;
    /* Wider to accommodate large ruler */
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lbr-header {
    text-align: center;
    margin-bottom: 25px;
}

.lbr-header h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 24px;
}

.lbr-input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.lbr-input-group label {
    font-size: 16px;
    font-weight: 500;
}

.lbr-input-group input {
    padding: 10px 15px;
    font-size: 22px;
    /* Bigger input font */
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    width: 160px;
    font-weight: bold;
    color: #c00;
}

.lbr-input-group button {
    padding: 12px 24px;
    background: #444;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.lbr-input-group button:hover {
    background: #222;
}

.lbr-ruler-viewport {
    position: relative;
    width: 100%;
    /* Must match LAYOUT.rulerHeight in JS for correct ratio */
    height: 340px;
    border: 1px solid #999;
    background: #fdfae3;
    cursor: grab;
    user-select: none;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.lbr-ruler-viewport:active {
    cursor: grabbing;
}

.lbr-cursor-line {
    position: absolute;
    left: calc(50% + 110px);
    /* 50% + SIDEBAR_W/2 (220/2) */
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(220, 0, 0, 0.9);
    z-index: 10;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
}

.lbr-cursor-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    border-width: 8px 9px 0 9px;
    border-style: solid;
    border-color: #d00 transparent transparent transparent;
}

canvas#lbr-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Info Panel Grid */
.lbr-info-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .lbr-cursor-line {
        left: 50%;
        /* Center on mobile (SIDEBAR_W = 0) */
    }

    .lbr-info-panel {
        grid-template-columns: 1fr;
    }

    .lbr-ruler-viewport {
        height: 340px;
    }

    /* Mobile Input Optimization */
    .lbr-input-group {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .lbr-input-group label {
        margin-bottom: 5px;
    }

    .lbr-input-group input {
        width: 100%;
        /* Full width */
        font-size: 18px;
    }

    .lbr-input-group button {
        width: 100%;
        /* Full width button */
        padding: 12px;
    }
}

.lbr-info-box {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.lbr-box-header {
    background: #f8f8f8;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 15px;
    border-bottom: 1px solid #eaeaea;
    color: #555;
    text-align: center;
}

.lbr-box-content {
    padding: 20px;
    text-align: center;
}

.lbr-status {
    display: block;
    font-size: 24px;
    /* Big Status Text */
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.lbr-meaning {
    display: block;
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

/* Dynamic Classes */
.lbr-info-box.good .lbr-status {
    color: #d00;
}

.lbr-info-box.bad .lbr-status {
    color: #333;
}

.lbr-info-box.good {
    border-top: 4px solid #d00;
}

.lbr-info-box.bad {
    border-top: 4px solid #333;
}

.lbr-note {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-top: 20px;
}