.coords-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.coords-workspace {
    flex: 1;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    min-height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.coords-workspace.drag-over {
    background: #e0f2fe;
    border-color: var(--primary-blue);
}

.coords-workspace.has-image {
    background: transparent;
    border: none;
    align-items: center;
    /* Center initially, scrolling handled by container */
    overflow: auto;
    /* Enable scrolling */
}

/* Upload */
.upload-section {
    padding: 40px;
    text-align: center;
    width: 100%;
}

.upload-placeholder {
    cursor: pointer;
    padding: 40px;
    border-radius: 12px;
    transition: transform 0.2s;
}

.upload-placeholder:hover {
    transform: translateY(-2px);
}

/* Image Wrapper */
.image-wrapper {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    margin: 20px;
    max-width: 100%;
}

#sourceImage {
    display: block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Markers */
.marker-dot {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--primary-red, #ef4444);
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Let clicks pass through if needed, but we might want them interactive? */
    z-index: 10;
}

/* Crosshair Lines */
.crosshair-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 5;
    display: none;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.crosshair-line.horizontal {
    height: 1px;
    width: 100%;
    left: 0;
}

.crosshair-line.vertical {
    width: 1px;
    height: 100%;
    top: 0;
}

/* Sidebar */
.coords-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.panel-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.panel-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    padding-bottom: 8px;
    border-bottom: 1px dashed #f1f5f9;
}

.info-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-row .label {
    color: #64748b;
}

.info-row .value {
    color: #334155;
    font-weight: 600;
}

.text-truncate {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Current Pos */
.pos-display {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.pos-item {
    flex: 1;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.pos-item .label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 4px;
}

.pos-item .value {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.hint-text {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

/* Saved Points List */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 4px;
}

.icon-btn:hover {
    color: var(--primary-blue);
}

.icon-btn.danger:hover {
    color: #ef4444;
}

.points-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.point-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.point-item:hover {
    background: #f1f5f9;
    border-color: var(--primary-blue);
}

.point-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.point-index {
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.point-coords {
    font-family: monospace;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.point-remove {
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.point-remove:hover {
    color: #ef4444;
}

.file-actions-panel {
    text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
    .coords-layout {
        flex-direction: column;
    }

    .coords-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .panel-card {
        flex: 1;
        min-width: 250px;
    }
}